using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Drawing.Printing; using System.Globalization; using System.IO; using System.IO.Ports; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Reflection; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Text; using System.Threading; using System.Windows.Forms; using System.Xml; using Microsoft.Win32; using MySql.Data.MySqlClient; using Navigator.Properties; namespace Navigator { // Token: 0x02000009 RID: 9 public partial class frm : Form { // Token: 0x0600002E RID: 46 RVA: 0x000027CC File Offset: 0x000009CC private void InitializePopUp() { this.itemData.Columns.Add("ItemType", typeof(frm.itemType)); this.itemData.Columns.Add("ItemName", typeof(string)); this.itemData.Columns.Add("ItemTag", typeof(string)); this.itemData.Columns.Add("ItemWidth", typeof(int)); this.itemData.Columns.Add("AddButtonClickEvent", typeof(bool)); this.itemData.Columns.Add("AddComboClickEvent", typeof(bool)); this.flpMenu.AutoScroll = true; this.flpMenu.AutoSize = true; this.flpMenu.Dock = DockStyle.Fill; this.flpMenu.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.flpMenu.FlowDirection = FlowDirection.TopDown; this.flpMenu.BorderStyle = BorderStyle.FixedSingle; this.flpMenu.WrapContents = false; this.frmPopupMenu.ShowInTaskbar = false; this.frmPopupMenu.FormBorderStyle = FormBorderStyle.None; this.frmPopupMenu.Visible = false; this.frmPopupMenu.KeyDown += this.frmMenu_KeyDown; this.frmPopupMenu.KeyPreview = true; this.frmPopupMenu.StartPosition = FormStartPosition.Manual; this.frmPopupMenu.Controls.Add(this.flpMenu); } // Token: 0x0600002F RID: 47 RVA: 0x00002968 File Offset: 0x00000B68 public void AddPopupButton(string ItemName, string ItemTag, int ItemWidth, bool AddButtonMouseUpEvent, bool AddComboMouseUpEvent) { this.itemData.Rows.Add(new object[] { frm.itemType.Button, ItemName, ItemTag, ItemWidth, AddButtonMouseUpEvent, AddComboMouseUpEvent }); } // Token: 0x06000030 RID: 48 RVA: 0x000029C0 File Offset: 0x00000BC0 public void AddPopupLabel(string ItemName) { this.itemData.Rows.Add(new object[] { frm.itemType.Label, ItemName, string.Empty, 0, false, false }); } // Token: 0x06000031 RID: 49 RVA: 0x00002A18 File Offset: 0x00000C18 public void AddPopupDivider() { this.itemData.Rows.Add(new object[] { frm.itemType.Divider, string.Empty, string.Empty, 0, false, false }); } // Token: 0x06000032 RID: 50 RVA: 0x00002A74 File Offset: 0x00000C74 public void ShowPopup(Control Caller, frm.menuLocation MenuLocation, frm.colorScheme ColorScheme, frm.menuOffset MenuOffset, frm.menuWidth MenuWidth) { this.frmPopupMenu.Visible = false; this.callingControl = Caller; this.flpMenu.Controls.Clear(); if (ColorScheme == frm.colorScheme.MainForm) { this.frmPopupMenu.BackColor = this.StyleColorPlusX(5, this.schemeBackColor); } else if (ColorScheme == frm.colorScheme.FlyOut) { this.frmPopupMenu.BackColor = this.StyleColorPlusX(5, this.Rightflyout.backColor); } foreach (object obj in this.itemData.Rows) { DataRow dataRow = (DataRow)obj; if ((frm.itemType)dataRow["ItemType"] == frm.itemType.Divider) { Label label = new Label(); label.Anchor = (AnchorStyles.Left | AnchorStyles.Right); label.AutoSize = true; label.BackColor = Color.White; label.Height = 2; label.Margin = new Padding(0, 0, 0, 8); if (MenuWidth == frm.menuWidth.Auto) { label.AutoSize = true; } else { label.Width = Caller.Width - this.vertScrollWidth; } this.flpMenu.Controls.Add(label); } else if ((frm.itemType)dataRow["ItemType"] == frm.itemType.Label) { Label label2 = new Label(); label2.Anchor = (AnchorStyles.Left | AnchorStyles.Right); if (Convert.ToInt32(dataRow["itemWidth"].ToString()) > 0) { label2.Width = Convert.ToInt32(dataRow["itemWidth"]); } else { label2.AutoSize = true; } label2.Font = new Font("Segoe UI", 11f); label2.ForeColor = Color.FromArgb(255, 119, 40); label2.Margin = new Padding(0, 10, 0, 0); label2.Padding = new Padding(0, 0, this.vertScrollWidth, 0); label2.TextAlign = ContentAlignment.BottomLeft; label2.Text = dataRow["ItemName"].ToString(); this.flpMenu.Controls.Add(label2); } else if ((frm.itemType)dataRow["ItemType"] == frm.itemType.TextBox) { Console.WriteLine("ContextMenu - TextBox - ItemWidth:" + Convert.ToInt32(dataRow["itemWidth"]).ToString()); TextBox textBox = new TextBox(); textBox.Height = 45; textBox.Width = Convert.ToInt32(dataRow["itemWidth"]) - this.vertScrollWidth - 10; textBox.Margin = new Padding(5, 5, 5, 5); textBox.Font = new Font("Segoe UI", 11f); textBox.KeyDown += this.txtBox_KeyDown; this.flpMenu.Controls.Add(textBox); } else { Button button = new Button(); button.FlatStyle = FlatStyle.Flat; if (ColorScheme == frm.colorScheme.MainForm) { button.FlatAppearance.MouseOverBackColor = this.schemeMouseOver; button.FlatAppearance.MouseDownBackColor = this.schemeMouseDown; button.BackColor = this.StyleColorPlusX(5, this.schemeBackColor); } else if (ColorScheme == frm.colorScheme.FlyOut) { button.FlatAppearance.MouseOverBackColor = this.Rightflyout.mouseOverColor; button.FlatAppearance.MouseDownBackColor = this.Rightflyout.mouseDownColor; button.BackColor = this.StyleColorPlusX(5, this.Rightflyout.backColor); } button.FlatAppearance.BorderSize = 0; button.Text = dataRow["ItemName"].ToString(); button.Tag = dataRow["ItemTag"].ToString(); button.Font = new Font("Segoe UI", 11f); button.TextAlign = ContentAlignment.MiddleLeft; button.ForeColor = Color.White; button.Margin = new Padding(0, 0, 0, 0); if (MenuWidth == frm.menuWidth.Auto) { button.AutoSize = true; button.Anchor = (AnchorStyles.Left | AnchorStyles.Right); } else { button.Width = Caller.Width - this.vertScrollWidth; } button.Height = 45; if (Convert.ToBoolean(dataRow["AddComboClickEvent"].ToString())) { button.Click += this.PopupCombo_Click; } if (Convert.ToBoolean(dataRow["AddButtonClickEvent"].ToString())) { button.Click += this.PopupButton_Click; } button.GotFocus += this.btnMenu_GotFocus; button.LostFocus += this.btnMenu_LostFocus; this.flpMenu.Controls.Add(button); } } int num = 5; int num2 = 0; int num3 = this.flpMenu.Controls.Count - 1; for (int i = 0; i <= num3; i++) { num += this.flpMenu.Controls[i].Height + this.flpMenu.Controls[i].Margin.Bottom + this.flpMenu.Controls[i].Margin.Top; if (this.flpMenu.Controls[i].Width > num2) { num2 = this.flpMenu.Controls[i].Width; } } this.frmPopupMenu.Height = num; if (MenuWidth == frm.menuWidth.CallerWidth) { this.frmPopupMenu.Width = Caller.Width; } else { this.frmPopupMenu.Width = num2 + this.vertScrollWidth; } Console.WriteLine("Menu Location - " + frm.menuLocation.BellowCaller.ToString()); if (MenuLocation == frm.menuLocation.BellowCaller) { Point location = Caller.Parent.PointToScreen(Caller.Location); int x; if (MenuOffset == frm.menuOffset.Left) { x = location.X; } else { x = location.X - (this.frmPopupMenu.Width - Caller.Width); } int num4 = location.Y + Caller.Height + 2; this.frmPopupMenu.Location = new Point(x, num4); } else { Point location = Caller.Parent.PointToScreen(Caller.Location); if (location.Y + this.frmPopupMenu.Height < base.Height) { this.frmPopupMenu.Location = location; } else if ((location.Y + this.frmPopupMenu.Height) / 2 < base.Height) { int x; if (MenuOffset == frm.menuOffset.Left) { x = location.X; } else { x = location.X - (this.frmPopupMenu.Width - Caller.Width); } int num4 = location.Y - this.frmPopupMenu.Height / 2; if (num4 < 0) { num4 = 10; } Point location2 = new Point(x, num4); this.frmPopupMenu.Location = location2; } else { int x; if (MenuOffset == frm.menuOffset.Left) { x = location.X; } else { x = location.X - (this.frmPopupMenu.Width - Caller.Width); } int num4 = location.Y - this.frmPopupMenu.Height + Caller.Height; Point location2 = new Point(x, num4); this.frmPopupMenu.Location = location2; } } if (this.frmPopupMenu.Location.Y + num > base.Height) { this.frmPopupMenu.Height = base.Height - this.frmPopupMenu.Location.Y - 10; } this.itemData.Rows.Clear(); this.frmPopupMenu.Show(base.Owner); this.flpMenu.Controls[0].Select(); } // Token: 0x06000033 RID: 51 RVA: 0x000033C4 File Offset: 0x000015C4 private void PopupButton_Click(object sender, EventArgs e) { string text = ((Button)sender).Tag.ToString().ToLower(); string text2 = text; switch (text2) { case "conf_companies": this.Rightflyout.ConfigureCompanies(); goto IL_14C; case "stocktake_do_nothing": case "stocktake_view_variance": this.btnStockTake_PrintSheetTo.Visible = false; goto IL_14C; case "stocktake_print_variance": this.btnStockTake_PrintSheetTo.Visible = true; goto IL_14C; case "drawer_type": this.SetDrawerConfigType(); goto IL_14C; case "backup": this.Rightflyout.Backup(); goto IL_14C; case "report_designer": this.Rightflyout.Designer(); goto IL_14C; case "change_company": this.Rightflyout.ChangeCompany(); goto IL_14C; } this.Rightflyout.RunAddIn(((Button)sender).Tag.ToString()); IL_14C: this.frmPopupMenu.Visible = false; } // Token: 0x06000034 RID: 52 RVA: 0x0000352A File Offset: 0x0000172A private void btnMenu_GotFocus(object sender, EventArgs e) { Console.WriteLine("btnMenu Got focus"); ((Button)sender).FlatAppearance.BorderSize = 1; } // Token: 0x06000035 RID: 53 RVA: 0x0000354A File Offset: 0x0000174A private void btnMenu_LostFocus(object sender, EventArgs e) { Console.WriteLine("btnMenu Lost focus"); ((Button)sender).FlatAppearance.BorderSize = 0; } // Token: 0x06000036 RID: 54 RVA: 0x0000356C File Offset: 0x0000176C private void PopupCombo_Click(object sender, EventArgs e) { if (sender.GetType() == typeof(Button)) { this.callingControl.Text = ((Button)sender).Text.Trim(); } this.frmPopupMenu.Visible = false; } // Token: 0x06000037 RID: 55 RVA: 0x000035C4 File Offset: 0x000017C4 private void txtBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return) { this.callingControl.Text = ((TextBox)sender).Text; this.frmPopupMenu.Visible = false; } else if (e.KeyCode == Keys.Escape) { this.frmPopupMenu.Visible = false; } } // Token: 0x06000038 RID: 56 RVA: 0x0000362C File Offset: 0x0000182C private void frmMenu_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { this.frmPopupMenu.Visible = false; } } // Token: 0x06000039 RID: 57 RVA: 0x0000365C File Offset: 0x0000185C private bool IsWinXP() { OperatingSystem osversion = Environment.OSVersion; return osversion.Platform == PlatformID.Win32NT && osversion.Version.Major == 5; } // Token: 0x0600003A RID: 58 RVA: 0x00003690 File Offset: 0x00001890 private void InitializeBackup() { this.mb = new MySqlBackup(); this.mb.ExportProgressChanged += this.mb_ExportProgressChanged; this.timer1 = new System.Windows.Forms.Timer(); this.timer1.Interval = 100; this.timer1.Tick += this.timer1_Tick; this.bwExport = new BackgroundWorker(); this.bwExport.DoWork += this.bwExport_DoWork; this.bwExport.RunWorkerCompleted += this.bwExport_RunWorkerCompleted; this.timer2 = new System.Windows.Forms.Timer(); this.timer2.Interval = 100; this.timer2.Tick += this.timer2_Tick; this.mb.ImportProgressChanged += this.mb_ImportProgressChanged; this.bwImport = new BackgroundWorker(); this.bwImport.DoWork += this.bwImport_DoWork; this.bwImport.RunWorkerCompleted += this.bwImport_RunWorkerCompleted; this.bwCopy = new BackgroundWorker(); this.bwCopy.WorkerReportsProgress = true; this.bwCopy.ProgressChanged += this.bwCopy_ProgressChanged; this.bwCopy.DoWork += this.bwCopy_DoWork; this.bwCopy.RunWorkerCompleted += this.bwCopy_RunWorkerCompleted; } // Token: 0x0600003B RID: 59 RVA: 0x00003811 File Offset: 0x00001A11 private void btnBackup_Click(object sender, EventArgs e) { this.BackupPPOS(); } // Token: 0x0600003C RID: 60 RVA: 0x0000381B File Offset: 0x00001A1B private void btnRestore_Click(object sender, EventArgs e) { this.RestorePPOS(); } // Token: 0x0600003D RID: 61 RVA: 0x00003825 File Offset: 0x00001A25 private void btnBackupAdvanced_Click(object sender, EventArgs e) { this.lblBackupAdvanced.Visible = !this.lblBackupAdvanced.Visible; this.chkIncludeSystemFiles.Visible = !this.chkIncludeSystemFiles.Visible; } // Token: 0x0600003E RID: 62 RVA: 0x0000385C File Offset: 0x00001A5C private void BackupPPOS() { if (string.IsNullOrEmpty(this.lastBackupFolder)) { this.ShowMessage("Specify Backup destination.", "PPOS will ask you where you want to save the backup files.\nPlease note that the destination must not contain any spaces i.e: C:\\Program Files\\Backup is not valid.", "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) { folderBrowserDialog.Description = "Choose a backup folder for the backup files to go to \nNote: No spaces are allowed in folder names."; folderBrowserDialog.ShowNewFolderButton = true; if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { if (folderBrowserDialog.SelectedPath.ToString().Contains(" ")) { this.ShowMessage("Invalid destination", string.Concat(new string[] { "The backup destination: ", folderBrowserDialog.SelectedPath.ToString(), " contains spaces\nFor example: C:\\", "PPOS".Replace(" ", "-"), "-Backup - will be acceptable. Please choose another destination." }), "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } else { this.backupPath = folderBrowserDialog.SelectedPath; this.BackupDatabase(this.backupPath); } } } } else if (Directory.Exists(this.lastBackupFolder)) { this.backupPath = this.lastBackupFolder; this.BackupDatabase(this.backupPath); this.btnBackup.Enabled = false; this.btnRestore.Enabled = false; this.chkIncludeSystemFiles.Enabled = false; } else if (this.ShowMessage("Check backup destination", "The destination: " + this.lastBackupFolder + "... has been moved or renamed.\nPlease choose another destination for your backup files?", "&OK", "&Cancel ", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) { folderBrowserDialog.Description = "Choose a backup folder for the backup files to go to"; folderBrowserDialog.ShowNewFolderButton = true; if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { this.backupPath = folderBrowserDialog.SelectedPath; this.BackupDatabase(this.backupPath); } } } } // Token: 0x0600003F RID: 63 RVA: 0x00003A94 File Offset: 0x00001C94 private void RestorePPOS() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.DefaultExt = ".sql"; openFileDialog.Title = "Search for a backup file..."; if (this.lastBackupFolder.Length > 0) { openFileDialog.InitialDirectory = this.lastBackupFolder; } if (openFileDialog.ShowDialog() == DialogResult.OK) { this.restoreFileName = openFileDialog.FileName; this.RestoreDatabase(); this.btnBackup.Enabled = false; this.btnRestore.Enabled = false; this.chkIncludeSystemFiles.Enabled = false; } } // Token: 0x06000040 RID: 64 RVA: 0x00003B30 File Offset: 0x00001D30 private void BackupDatabase(string path) { this.Rightflyout.lblProgress.Text = "0%"; this.Rightflyout.lblCurrProcedure.Text = "n/a"; this.Rightflyout.Top = base.Top; this.Rightflyout.Left = base.Width + this.Rightflyout.Width; this.Rightflyout.Height = base.Height - 3; this.Rightflyout.flyOutReason = Flyout.Caller.Backup_Restore; this.Rightflyout.tabFlyOut.SelectedTab = this.Rightflyout.pFlyOutProgress; this.Rightflyout.lblFlyOutHeading.Text = "Backup progress"; this.Rightflyout.btnOK.Visible = false; this.Rightflyout.Show(this); string text = string.Format("server={0};user={1};pwd={2};database={3};port={4};", new object[] { this.serverName, this.userName, this.passWord, this.databaseName, this.portName }); this.dumpFile = string.Concat(new string[] { path, "\\", this.databaseName, "-", DateTime.Now.DayOfWeek.ToString(), ".sql" }); this._currentTableName = ""; this._totalRowsInCurrentTable = 0; this._totalRowsInAllTables = 0; this._currentRowIndexInCurrentTable = 0; this._currentRowIndexInAllTable = 0; this._totalTables = 0; this._currentTableIndex = 0; this.conn = new MySqlConnection(text); this.cmd = new MySqlCommand(); this.cmd.Connection = this.conn; this.conn.Open(); this.timer1.Start(); this.mb.ExportInfo.IntervalForProgressReport = 100; this.mb.ExportInfo.GetTotalRowsBeforeExport = true; this.mb.Command = this.cmd; this.bwExport.RunWorkerAsync(); } // Token: 0x06000041 RID: 65 RVA: 0x00003D58 File Offset: 0x00001F58 private void bwExport_DoWork(object sender, DoWorkEventArgs e) { try { this.mb.ExportToFile(this.dumpFile); } catch (Exception ex) { this.CloseConnection(); this.backupError = ex.ToString(); } } // Token: 0x06000042 RID: 66 RVA: 0x00003DA8 File Offset: 0x00001FA8 private void CloseConnection() { if (this.conn != null) { this.conn.Close(); this.conn.Dispose(); } if (this.cmd != null) { this.cmd.Dispose(); } if (this.mb != null) { this.mb.StopAllProcess(); } } // Token: 0x06000043 RID: 67 RVA: 0x00003E14 File Offset: 0x00002014 private void mb_ExportProgressChanged(object sender, ExportProgressArgs e) { this._currentRowIndexInAllTable = (int)e.CurrentRowIndexInAllTables; this._currentRowIndexInCurrentTable = (int)e.CurrentRowIndexInCurrentTable; this._currentTableIndex = e.CurrentTableIndex; this._currentTableName = e.CurrentTableName; this._totalRowsInAllTables = (int)e.TotalRowsInAllTables; this._totalRowsInCurrentTable = (int)e.TotalRowsInCurrentTable; this._totalTables = e.TotalTables; } // Token: 0x06000044 RID: 68 RVA: 0x00003E7C File Offset: 0x0000207C private void timer1_Tick(object sender, EventArgs e) { this.Rightflyout.lblCurrProcedure.Text = "Backing up table: " + this._currentTableName; if (this._totalRowsInAllTables != 0) { this.Rightflyout.lblProgress.Text = ((float)this._currentRowIndexInAllTable / (float)this._totalRowsInAllTables * 100f).ToString("##") + "%"; } } // Token: 0x06000045 RID: 69 RVA: 0x00003EF8 File Offset: 0x000020F8 private void bwExport_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { this.CloseConnection(); Thread.Sleep(100); if (this.mb.LastError != null) { this.backupError = this.mb.LastError.ToString(); } this.timer1.Stop(); if (this.chkIncludeSystemFiles.Checked) { this.Rightflyout.lblProgress.Text = "0%"; this.Rightflyout.lblCurrProcedure.Text = "Copying files and folders..."; this.sourcePath = AppDomain.CurrentDomain.BaseDirectory; this.destinationPath = this.backupPath; this.fileCount = this.GetFileCount(this.sourcePath); this.bwCopy.RunWorkerAsync(); } else { if (string.IsNullOrEmpty(this.backupError) && string.IsNullOrEmpty(this.fileCopyError)) { this.ShowNotification("Backup completed", string.Empty, frm.NotificationColor.Green); } else { this.ShowMessage("Completed with error(s).", this.backupError + "\n" + this.fileCopyError, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } this.lastBackupFolder = this.backupPath; this.SaveConfToXML(); this.Rightflyout.Hide(); } } // Token: 0x06000046 RID: 70 RVA: 0x00004058 File Offset: 0x00002258 private void RestoreDatabase() { this.Rightflyout.lblProgress.Text = "0%"; this.Rightflyout.lblCurrProcedure.Text = "Restoring database..."; this.Rightflyout.Top = base.Top; this.Rightflyout.Left = base.Width + this.Rightflyout.Width; this.Rightflyout.Height = base.Height - 3; this.Rightflyout.flyOutReason = Flyout.Caller.Backup_Restore; this.Rightflyout.tabFlyOut.SelectedTab = this.Rightflyout.pFlyOutProgress; this.Rightflyout.lblFlyOutHeading.Text = "Restore progress"; this.Rightflyout.btnOK.Visible = false; this.Rightflyout.Show(this); string text = string.Format("server={0};user={1};pwd={2};database={3};port={4};", new object[] { this.serverName, this.userName, this.passWord, this.databaseName, this.portName }); this.curBytes = 0; this.totalBytes = 0; this.conn = new MySqlConnection(text); this.cmd = new MySqlCommand(); this.cmd.Connection = this.conn; this.conn.Open(); this.timer2.Start(); this.mb.ImportInfo.IntervalForProgressReport = 50; this.mb.Command = this.cmd; this.mb.Command.CommandTimeout = 600; this.bwImport.RunWorkerAsync(); } // Token: 0x06000047 RID: 71 RVA: 0x0000420C File Offset: 0x0000240C private void bwImport_DoWork(object sender, DoWorkEventArgs e) { try { this.mb.ImportFromFile(this.restoreFileName); } catch (Exception ex) { this.restoreError = ex.ToString(); } } // Token: 0x06000048 RID: 72 RVA: 0x00004254 File Offset: 0x00002454 private void timer2_Tick(object sender, EventArgs e) { if (this.totalBytes != 0) { this.Rightflyout.lblProgress.Text = ((float)this.curBytes / (float)this.totalBytes * 100f).ToString("##") + "%"; } } // Token: 0x06000049 RID: 73 RVA: 0x000042AE File Offset: 0x000024AE private void mb_ImportProgressChanged(object sender, ImportProgressArgs e) { this.totalBytes = (int)e.TotalBytes; this.curBytes = (int)e.CurrentBytes; } // Token: 0x0600004A RID: 74 RVA: 0x000042CC File Offset: 0x000024CC private void bwImport_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { this.CloseConnection(); Thread.Sleep(100); if (this.mb.LastError != null) { this.restoreError = this.mb.LastError.ToString(); } this.timer2.Stop(); if (this.chkIncludeSystemFiles.Checked) { this.Rightflyout.lblProgress.Text = "0%"; this.Rightflyout.lblCurrProcedure.Text = "Copying files and folders..."; this.destinationPath = AppDomain.CurrentDomain.BaseDirectory; this.sourcePath = this.backupPath; this.fileCount = this.GetFileCount(this.destinationPath); this.bwCopy.RunWorkerAsync(); } if (string.IsNullOrEmpty(this.restoreError) && string.IsNullOrEmpty(this.fileCopyError)) { this.ShowNotification("Restore completed", string.Empty, frm.NotificationColor.Green); } else { this.ShowMessage("Completed with error(s).", this.restoreError + "\n" + this.fileCopyError, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } this.Rightflyout.Hide(); } // Token: 0x0600004B RID: 75 RVA: 0x00004410 File Offset: 0x00002610 public int GetFileCount(string sourceDirectory) { return Directory.GetFiles(sourceDirectory, "*.*", SearchOption.AllDirectories).Length; } // Token: 0x0600004C RID: 76 RVA: 0x00004430 File Offset: 0x00002630 private void bwCopy_DoWork(object sender, DoWorkEventArgs e) { try { this.CopyFoldersAndFiles(this.sourcePath, this.destinationPath); } catch (Exception ex) { this.fileCopyError = ex.ToString(); } } // Token: 0x0600004D RID: 77 RVA: 0x00004478 File Offset: 0x00002678 public void CopyFoldersAndFiles(string sourceDirectory, string targetDirectory) { DirectoryInfo source = new DirectoryInfo(sourceDirectory); DirectoryInfo target = new DirectoryInfo(targetDirectory); this.CopyAll(source, target); } // Token: 0x0600004E RID: 78 RVA: 0x000044A0 File Offset: 0x000026A0 public void CopyAll(DirectoryInfo source, DirectoryInfo target) { if (!Directory.Exists(target.FullName)) { Directory.CreateDirectory(target.FullName); } foreach (FileInfo fileInfo in source.GetFiles()) { fileInfo.CopyTo(Path.Combine(target.ToString(), fileInfo.Name), true); this.currFile++; int percentProgress = (int)((float)this.currFile / (float)this.fileCount * 100f); this.bwCopy.ReportProgress(percentProgress); } foreach (DirectoryInfo directoryInfo in source.GetDirectories()) { DirectoryInfo target2 = target.CreateSubdirectory(directoryInfo.Name); this.CopyAll(directoryInfo, target2); } } // Token: 0x0600004F RID: 79 RVA: 0x00004584 File Offset: 0x00002784 private void bwCopy_ProgressChanged(object sender, ProgressChangedEventArgs e) { this.Rightflyout.lblProgress.Text = e.ProgressPercentage.ToString() + "%"; } // Token: 0x06000050 RID: 80 RVA: 0x000045BC File Offset: 0x000027BC private void bwCopy_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { this.fileCopyError = e.Error.ToString(); } if (string.IsNullOrEmpty(this.backupError) && string.IsNullOrEmpty(this.fileCopyError)) { this.ShowNotification("Backup completed", string.Empty, frm.NotificationColor.Green); } else { this.ShowMessage("Completed with error(s).", this.backupError + "\n" + this.fileCopyError, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } this.lastBackupFolder = this.backupPath; this.SaveConfToXML(); this.Rightflyout.Hide(); } // Token: 0x06000051 RID: 81 RVA: 0x00004674 File Offset: 0x00002874 public void SetButtonBarState(frm.btnBarStates state) { this.tlpButtonBar.Visible = false; this.btnConfigure.Visible = false; this.btnTools.Visible = false; this.btnInfo.Visible = false; this.btnEdit.Visible = false; this.btnAdd.Visible = false; this.btnRemove.Visible = false; this.btnPrevious.Visible = false; this.btnNext.Visible = false; this.lblDivider1.Visible = false; this.lblDivider2.Visible = false; switch (state) { case frm.btnBarStates.StartUp: this.tlpButtonBar.Visible = false; this.tabMain.SelectedTab = this.pStartUp; break; case frm.btnBarStates.Login: if (this.FirstTimeUseSetup) { this.lblMenuTitle.Text = "Connect online..."; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; } else { this.lblMenuTitle.Text = "Connect to a database..."; this.btnPrevious.Image = Resources.Close; this.btnPrevious.Text = "Close"; } this.btnPrevious.Visible = true; this.tlpButtonBar.Visible = true; this.btnNext.Visible = true; this.tabMain.SelectedTab = this.pConnectionLogin; break; case frm.btnBarStates.UserLogin: this.lblMenuTitle.Text = "Login"; this.tlpButtonBar.Visible = true; this.btnPrevious.Visible = true; this.btnPrevious.Image = Resources.Close; this.btnPrevious.Text = "Close"; this.tabMain.SelectedTab = this.pUserLogin; break; case frm.btnBarStates.Welcome: this.lblMenuTitle.Text = string.Empty; this.tlpButtonBar.Visible = true; this.btnPrevious.Visible = true; this.btnNext.Image = Resources.Next; this.btnNext.Visible = true; this.btnPrevious.Image = Resources.Close; this.btnPrevious.Text = "Close"; this.tabMain.SelectedTab = this.pWelcome; break; case frm.btnBarStates.ServerType: this.lblMenuTitle.Text = string.Empty; this.tlpButtonBar.Visible = true; this.btnPrevious.Visible = true; this.btnNext.Image = Resources.Next; this.btnNext.Visible = true; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; this.tabMain.SelectedTab = this.pServerType; break; case frm.btnBarStates.Companies: this.tlpButtonBar.Visible = true; this.lblMenuTitle.Text = "My Companies"; this.btnEdit.Visible = true; this.btnAdd.Visible = true; this.btnRemove.Visible = true; this.btnPrevious.Visible = true; this.btnNext.Image = Resources.OK; this.btnNext.Text = "OK"; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; this.tabMain.SelectedTab = this.pCompanies; break; case frm.btnBarStates.ConfFinal: this.tlpButtonBar.Visible = false; this.btnPrevious.Image = Resources.Close; this.btnPrevious.Text = "Close"; this.tabMain.SelectedTab = this.pConfFinal; break; case frm.btnBarStates.Information: this.tlpButtonBar.Visible = true; this.lblMenuTitle.Text = "PPOS"; this.btnPrevious.Visible = true; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; this.tabMain.SelectedTab = this.pInfo; break; case frm.btnBarStates.MainMenu: this.flpMain.Padding = new Padding(0, 0, this.vertScrollWidth, 0); this.tlpButtonBar.Visible = true; this.lblMenuTitle.Text = this.currentCompanyName; this.btnInfo.Visible = true; this.btnConfigure.Visible = this.configureProgram; this.btnTools.Visible = this.useTools; this.btnPrevious.Visible = true; this.btnNext.Image = Resources.OK; this.btnNext.Text = "OK"; this.btnPrevious.Image = Resources.Close; this.btnPrevious.Text = "Close"; this.tabMain.SelectedTab = this.pMenu; break; case frm.btnBarStates.ChangeCompany: this.tlpButtonBar.Visible = true; this.lblMenuTitle.Text = "My Companies"; this.lblCompanies_Current.Text = this.currentCompanyName; this.btnPrevious.Visible = true; this.btnNext.Visible = true; this.btnNext.Image = Resources.OK; this.btnNext.Text = "OK"; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; this.tabMain.SelectedTab = this.pCompanies; break; case frm.btnBarStates.Backup: this.tlpButtonBar.Visible = true; this.lblMenuTitle.Text = "Backup PPOS"; this.btnPrevious.Visible = true; this.btnNext.Visible = false; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; this.tabMain.SelectedTab = this.pBackup; break; case frm.btnBarStates.ConfCompany: this.tlpConfigure.Padding = new Padding(0, 0, this.vertScrollWidth, 0); this.tlpButtonBar.Visible = true; this.lblMenuTitle.Text = "Company Setup"; this.btnPrevious.Image = Resources.Previous; this.btnPrevious.Text = "Prev"; this.btnPrevious.Visible = true; if (this.FirstTimeUseSetup) { this.btnNext.Image = Resources.Next; this.btnNext.Text = "Next"; } else { this.btnNext.Image = Resources.OK; this.btnNext.Text = "OK"; } this.btnNext.Visible = true; this.tabMain.SelectedTab = this.pCompanySetup; break; } } // Token: 0x06000052 RID: 82 RVA: 0x00004DB7 File Offset: 0x00002FB7 private void btnMinimize_Click(object sender, EventArgs e) { base.WindowState = FormWindowState.Minimized; } // Token: 0x06000053 RID: 83 RVA: 0x00004DC4 File Offset: 0x00002FC4 private void btnPrevious_Click(object sender, EventArgs e) { if (string.Compare(this.btnPrevious.Text, "close", true) == 0) { base.Close(); } else if (this.FirstTimeUseSetup) { if (this.tabMain.SelectedTab == this.pCompanySetup | this.tabMain.SelectedTab == this.pConnectionLogin | this.tabMain.SelectedTab == this.pStartUp) { this.SetButtonBarState(frm.btnBarStates.Welcome); } } else if (this.tabMain.SelectedTab == this.pCompanies & this.changingCompany) { this.changingCompany = false; this.SetButtonBarState(frm.btnBarStates.MainMenu); } else if (this.tabMain.SelectedTab == this.pInfo | this.tabMain.SelectedTab == this.pCompanies | this.tabMain.SelectedTab == this.pBackup) { this.SetButtonBarState(frm.btnBarStates.MainMenu); } else if (this.tabMain.SelectedTab == this.pCompanySetup) { this.LoadScheme(this.currentScheme); this.SetButtonBarState(frm.btnBarStates.Companies); this.lvCompanies.Focus(); } } // Token: 0x06000054 RID: 84 RVA: 0x00004F24 File Offset: 0x00003124 private void btnAdd_Click(object sender, EventArgs e) { this.recordStatus = frm.operationMode.Add; if (this.tabMain.SelectedTab == this.pCompanies) { this.ClearCompanyDetails(); this.FillAvailableProgramsListBox(); this.AddDefaultUsers(); this.SetButtonBarState(frm.btnBarStates.ConfCompany); this.optConfCompanyInfo.PerformClick(); this.txtCompanyName.Focus(); } } // Token: 0x06000055 RID: 85 RVA: 0x00004F8C File Offset: 0x0000318C private void btnEdit_Click(object sender, EventArgs e) { this.recordStatus = frm.operationMode.Edit; if (this.tabMain.SelectedTab == this.pCompanies) { if (this.lvCompanies.SelectedItems.Count > 0) { this.LoadCompanyDetails(); this.LoadConfiguration(Convert.ToInt32(this.lvCompanies.SelectedItems[0].Text)); this.optConfPurchaseRelatedOptions.Visible = this.purchasesModuleExist; this.optConfItemOptions.Visible = this.itemsModuleExist; this.SetButtonBarState(frm.btnBarStates.ConfCompany); this.optConfCompanyInfo.PerformClick(); this.txtCompanyName.Focus(); } } } // Token: 0x06000056 RID: 86 RVA: 0x0000504C File Offset: 0x0000324C private void btnRemove_Click(object sender, EventArgs e) { if (this.tabMain.SelectedTab == this.pCompanies) { if (this.lvCompanies.SelectedItems.Count > 0) { if (this.ShowMessage("Confirm removal", "This will remove the selected company.", "&Continue", "Ca&ncel", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { try { this.cmmMySql.CommandText = string.Format("UPDATE companies SET `Status` = '{0}' WHERE ID = {1};", frm.companyStatus.InActive, this.lvCompanies.SelectedItems[0].Text); this.cmmMySql.ExecuteNonQuery(); this.lvCompanies.Items.RemoveAt(this.lvCompanies.SelectedItems[0].Index); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } else if (this.tabMain.SelectedTab == this.pCompanySetup & this.tlpUserDetails.Visible) { if (this.lvConfUsers.SelectedItems.Count > 0) { if (this.ShowMessage("Confirm removal", "This will remove the selected user from the database.", "&Continue", "Ca&ncel", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { try { this.cmmMySql.CommandText = string.Format("UPDATE `users` SET UserName = 'not in use', Password = '', PictureName = '' WHERE UserID = {0} AND CompanyID = {1}", this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserID)].Text, this.currentCompanyID); this.cmmMySql.ExecuteNonQuery(); this.lvConfUsers.SelectedItems[0].Text = "not in use"; this.txtConfUserName.Text = "not in use"; this.txtConfUserPassword.Text = string.Empty; foreach (object obj in this.lstConfUsersAvailablePrograms.CheckedIndices) { int index = (int)obj; this.lstConfUsersAvailablePrograms.SetItemChecked(index, false); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } } // Token: 0x06000057 RID: 87 RVA: 0x0000531C File Offset: 0x0000351C private void btnInfo_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; this.SetButtonBarState(frm.btnBarStates.Information); Application.DoEvents(); this.lblInfoIP.Text = this.GetCurrentIP(); this.lblInfoComputerName.Text = Environment.MachineName; this.lblInfoOS.Text = Environment.OSVersion.ToString(); if (Environment.Is64BitOperatingSystem) { Label label = this.lblInfoOS; Label label3 = label; label3.Text += " - 64 bit"; } else { Label label2 = this.lblInfoOS; Label label4 = label2; label4.Text += " - 32 bit"; } if (this.isMultiUser) { this.lblInfoPPOSUserName.Text = this.userLoggedIn; } else { this.lblInfoPPOSUserName.Text = this.userName; } this.lblInfoLANstatus.Text = this.IsNetworkConnected(); this.lblVersion.Text = Application.ProductVersion; TimeSpan timeSpan = this.dateFromXml.Date - DateTime.Now.Date; this.lblLicence.Text = string.Format("{0} days", timeSpan.Days.ToString()); this.Cursor = Cursors.Default; } // Token: 0x06000058 RID: 88 RVA: 0x00005477 File Offset: 0x00003677 private void btnConfigure_Click(object sender, EventArgs e) { this.AddPopupLabel("Configure..."); this.AddPopupButton(" Companies ", "conf_companies", 0, true, false); this.ShowPopup(this.btnConfigure, frm.menuLocation.BellowCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.Auto); } // Token: 0x06000059 RID: 89 RVA: 0x000054D8 File Offset: 0x000036D8 private void btnTools_Click(object sender, EventArgs e) { this.AddPopupLabel("Tools..."); this.AddPopupButton(" Backup database", "backup", 0, true, false); this.AddPopupButton(" Report Designer", "report_designer", 0, true, false); this.AddPopupButton(" Change Company", "change_company", 0, true, false); string path = AppDomain.CurrentDomain.BaseDirectory + "Programs\\AddIns"; if (Directory.Exists(path)) { this.AddPopupLabel("Add-Ins..."); string[] files = Directory.GetFiles(path); IEnumerable enumerable = from file in files where file.EndsWith(".exe") || file.EndsWith(".lnk") select file; foreach (string text in enumerable) { this.AddPopupButton(" " + Path.GetFileNameWithoutExtension(text).Replace("_", " "), text, 0, true, false); } } this.ShowPopup(this.btnTools, frm.menuLocation.BellowCaller, frm.colorScheme.MainForm, frm.menuOffset.Right, frm.menuWidth.Auto); } // Token: 0x0600005A RID: 90 RVA: 0x00005614 File Offset: 0x00003814 private void btnNext_Click(object sender, EventArgs e) { if (this.FirstTimeUseSetup) { string name = this.tabMain.SelectedTab.Name; if (name != null) { if (!(name == "pWelcome")) { if (!(name == "pConnectionLogin")) { if (name == "pCompanySetup") { if (this.txtCompanyName.Text.Length == 0) { this.ShowMessage("Empty company name", "Please provide a company name before continuing.", "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); this.txtCompanyName.Focus(); } else { this.SetButtonBarState(frm.btnBarStates.ConfFinal); Application.DoEvents(); this.FinalizeFirstTimeConfiguration(); } } } else { this.lblStartUp.Text = "Connecting..."; this.lblStartUpMsg.Text = "Connecting to Online database. Please wait..."; this.tabMain.SelectedTab = this.pStartUp; Application.DoEvents(); int num = this.ConnectToOnlineServer(this.txtLoginIP.Text, this.txtLoginUserName.Text, this.txtLoginPassword.Text, this.txtLoginDatabaseName.Text, this.txtLoginPort.Text); if (num == 1) { this.lblStartUpMsg.Text = "Updating the database..."; Application.DoEvents(); this.CreateNewDatabase(); this.serverName = this.txtLoginIP.Text; this.userName = this.txtLoginUserName.Text; this.passWord = this.txtLoginPassword.Text; this.databaseName = this.txtLoginDatabaseName.Text; this.portName = this.txtLoginPort.Text; this.ClearCompanyDetails(); this.SetButtonBarState(frm.btnBarStates.ConfCompany); this.optConfCompanyInfo.PerformClick(); if (this.txtConfPaymentMethods.Text.Length == 0) { this.txtConfPaymentMethods.AppendText("Cash" + Environment.NewLine); } if (this.txtConfSlipNote_Invoices.Text.Length == 0) { this.txtConfSlipNote_Invoices.AppendText("Thanks for your support. Please call again!"); } this.txtCompanyName.Focus(); this.FillAvailableProgramsListBox(); this.AddDefaultUsers(); this.tConnectionStatus.Interval = 5000; this.tConnectionStatus.Start(); } else { this.ShowConnectionErrorMessage(num); } } } else if (this.optDatabaseLocal.Checked) { this.lblStartUp.Text = "Connecting..."; this.lblStartUpMsg.Text = "Starting the local database. Please wait..."; this.tabMain.SelectedTab = this.pStartUp; Application.DoEvents(); string currentIP = this.GetCurrentIP(); int num2 = this.ConnectToLocalServer(currentIP, "root", "", "pos3", "3307", this.isPortable); this.lblStartUpMsg.Text = "Connecting to the local database..."; Application.DoEvents(); if (num2 == 1) { base.Activate(); this.isConnected = true; this.serverName = currentIP; this.userName = "root"; this.databaseName = "pos3"; this.portName = "3307"; this.lblStartUpMsg.Text = "Updating the database..."; Application.DoEvents(); this.CreateNewDatabase(); this.ClearCompanyDetails(); this.SetButtonBarState(frm.btnBarStates.ConfCompany); this.optConfPurchaseRelatedOptions.Visible = this.purchasesModuleExist; this.optConfItemOptions.Visible = this.itemsModuleExist; this.optConfCompanyInfo.PerformClick(); if (this.txtConfPaymentMethods.Text.Length == 0) { this.txtConfPaymentMethods.AppendText("Cash" + Environment.NewLine); } if (this.txtConfSlipNote_Invoices.Text.Length == 0) { this.txtConfSlipNote_Invoices.AppendText("Thanks for your support. Please call again!"); } this.txtCompanyName.Focus(); this.FillAvailableProgramsListBox(); this.AddDefaultUsers(); this.tConnectionStatus.Interval = 5000; this.tConnectionStatus.Start(); } else { this.ShowMessage("Connection error.", "The server is probably still starting up.", "&Retry", string.Empty, true, false, true, frm.MessageColor.Blue); this.SetButtonBarState(frm.btnBarStates.Welcome); this.btnNext.PerformClick(); } } else { this.lblConnectionLoginSubTitle.Text = "Please provide your Online connection details and click Next to continue"; this.ClearConnectionDetails(); this.SetButtonBarState(frm.btnBarStates.Login); this.txtLoginUserName.Focus(); } } } else { string name = this.tabMain.SelectedTab.Name; if (name != null) { if (!(name == "pConnectionLogin")) { if (!(name == "pCompanies")) { if (!(name == "pCompanySetup")) { if (name == "pUserLogin") { this.lblUserLoginError.Visible = false; if (this.lblSelUserName.Text.Length > 0) { this.VerifyUserLogin(); } else { this.lblUserLoginError.Visible = true; this.lblUserLoginError.Text = "Please select a user, provide a password and then click Next."; } } } else if (this.txtCompanyName.Text.Length > 0) { bool newConfig = false; if (this.recordStatus == frm.operationMode.Add) { newConfig = true; } this.SaveConfiguration(newConfig, this.SaveCompanyDetails()); this.SaveConfToXML(); this.LoadCompanies(); this.SetButtonBarState(frm.btnBarStates.Companies); this.lvCompanies.Focus(); } else { this.ShowMessage("Empty company Name", "Please provide a name of this company, then try again.", "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); this.txtCompanyName.Focus(); } } else if (this.changingCompany) { if (this.lvCompanies.SelectedItems.Count > 0) { if (this.ShowMessage("Confirm change", "Please note that all relevant pograms will also be closed.\nDo you wish to continue?", "&Yes", "&No", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { this.CloseOpenPrograms(); this.currentCompanyName = this.lvCompanies.SelectedItems[0].SubItems[1].Text; this.currentCompanyID = Convert.ToInt32(this.lvCompanies.SelectedItems[0].Text); this.LoadScheme(this.lvCompanies.SelectedItems[0].SubItems[2].Text); this.currentScheme = this.lastLoadedScheme; this.changingCompany = false; this.SaveConfToXML(); this.SaveCurrentUser(); if (this.IsMultiUserCompanyFromDB()) { this.isMultiUser = true; this.lblSelUserMsg.Visible = false; this.txtUserLogin_Password.Visible = false; this.lblUserLoginError.Visible = false; this.txtUserLogin_Password.Text = string.Empty; this.ShowUserLoginScreen(); } else { this.userLoggedIn = string.Empty; this.lblSelUserName.Text = string.Empty; this.Text = "PPOS"; this.SetButtonBarState(frm.btnBarStates.MainMenu); } } } } } else if (this.databaseType == frm.dbType.online) { this.Cursor = Cursors.WaitCursor; this.lblStartUp.Text = "Connecting..."; this.lblStartUpMsg.Text = "Connecting to Online database. Please wait..."; this.SetButtonBarState(frm.btnBarStates.StartUp); Application.DoEvents(); int num = this.ConnectToOnlineServer(this.txtLoginIP.Text, this.txtLoginUserName.Text, this.txtLoginPassword.Text, this.txtLoginDatabaseName.Text, this.txtLoginPort.Text); if (num == 1) { this.isConnected = true; this.serverName = this.txtLoginIP.Text; this.portName = this.txtLoginPort.Text; this.databaseName = this.txtLoginDatabaseName.Text; this.passWord = this.txtLoginPassword.Text; this.userName = this.txtLoginUserName.Text; this.lblStartUpMsg.Text = "Updating the database..."; Application.DoEvents(); this.InitDatabaseUpdate(); this.Cursor = Cursors.Default; if (this.IsMultiUserCompanyFromDB()) { this.isMultiUser = true; this.ShowUserLoginScreen(); } else { this.FinalizeProgramLoading(); } } else { this.Cursor = Cursors.Default; this.ShowConnectionErrorMessage(num); } } else { this.Cursor = Cursors.WaitCursor; int num3 = this.ConnectToLocalServer(this.txtLoginIP.Text, this.txtLoginUserName.Text, this.txtLoginPassword.Text, this.txtLoginDatabaseName.Text, this.txtLoginPort.Text, this.isPortable); if (num3 == 1) { this.isConnected = true; this.serverName = this.txtLoginIP.Text; this.portName = this.txtLoginPort.Text; this.databaseName = this.txtLoginDatabaseName.Text; this.passWord = this.txtLoginPassword.Text; this.userName = this.txtLoginUserName.Text; this.lblStartUpMsg.Text = "Updating the database..."; Application.DoEvents(); this.InitDatabaseUpdate(); this.Cursor = Cursors.Default; if (this.IsMultiUserCompanyFromDB()) { this.isMultiUser = true; this.ShowUserLoginScreen(); } else { this.FinalizeProgramLoading(); } } else { this.Cursor = Cursors.Default; this.ShowConnectionErrorMessage(num3); } } } } } // Token: 0x0600005B RID: 91 RVA: 0x000060A4 File Offset: 0x000042A4 public void ClearCompanyDetails() { this.txtCompanyName.Text = string.Empty; this.txtCompanyEmail.Text = string.Empty; this.txtCompanyAddress.Text = string.Empty; this.txtCompanyReg.Text = string.Empty; this.txtCompanyVAT.Text = string.Empty; this.txtCompanyContact.Text = string.Empty; this.txtCompanyAltNo.Text = string.Empty; this.txtCompanyVatRate.Text = "0"; this.txtBankingDetails.Text = string.Empty; this.picInvoicePreview.Image = null; this.btnConfInvoiceSize.Text = "A4"; this.logoName = string.Empty; this.styleName = "_None.jpg"; this.imgLogo = null; this.imgStyle = Image.FromFile(this.stylesFolder + "\\Samples\\_None.jpg"); this.picInvoicePreview.Image = Image.FromFile(this.stylesFolder + "\\Samples\\_None.jpg"); this.btnFinYearStartMonth.Text = "January"; } // Token: 0x0600005C RID: 92 RVA: 0x000061D4 File Offset: 0x000043D4 public void LoadCompanies() { this.Cursor = Cursors.WaitCursor; this.cmmMySql.CommandText = string.Format("SELECT ID, Name, Scheme FROM companies WHERE `Status` = '{0}'", frm.companyStatus.Active); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { if (this.lvCompanies.Items.Count > 0) { this.lvCompanies.Items.Clear(); } while (this.drMySql.Read()) { this.lvCompanies.Items.Add(this.drMySql.GetString(0)); this.lvCompanies.Items[this.lvCompanies.Items.Count - 1].SubItems.Add(this.drMySql.GetString(1)); this.lvCompanies.Items[this.lvCompanies.Items.Count - 1].SubItems.Add(this.drMySql.GetString(2)); } } this.drMySql.Close(); this.Cursor = Cursors.Default; } // Token: 0x0600005D RID: 93 RVA: 0x00006320 File Offset: 0x00004520 private void LoadCompanyDetails() { this.Cursor = Cursors.WaitCursor; try { this.cmmMySql.CommandText = "SELECT * FROM companies WHERE ID = " + this.lvCompanies.SelectedItems[0].Text; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { this.drMySql.Read(); this.txtCompanyName.Text = this.drMySql.GetString("Name"); this.txtCompanyEmail.Text = this.drMySql.GetString("Email"); this.txtCompanyAddress.Text = this.drMySql.GetString("Address"); this.txtCompanyReg.Text = this.drMySql.GetString("RegNo"); this.txtCompanyVAT.Text = this.drMySql.GetString("VATno"); this.prevVatNumber = this.txtCompanyVAT.Text; this.txtCompanyVatRate.Text = this.drMySql.GetString("VATrate"); this.txtCompanyContact.Text = this.drMySql.GetString("ContactNo"); this.txtCompanyAltNo.Text = this.drMySql.GetString("AltNo"); this.logoName = this.drMySql.GetString("LogoPath"); this.styleName = this.drMySql.GetString("InvoiceStylePath"); this.btnConfInvoiceSize.Text = this.drMySql.GetString("InvoiceSize"); this.txtBankingDetails.Text = this.drMySql.GetString("BankingDetails"); if (this.drMySql.GetString("FinYearStartMonth").Length > 0) { foreach (KeyValuePair keyValuePair in this.FinYearStartMonth) { if (keyValuePair.Value == this.drMySql.GetInt32("FinYearStartMonth")) { this.btnFinYearStartMonth.Text = keyValuePair.Key; } } } else { this.btnFinYearStartMonth.Text = "January"; } this.picInvoicePreview.Image = null; this.LoadStyle(this.stylesFolder + "\\Samples\\" + this.styleName); this.LoadLogo(this.logosFolder + this.logoName); this.LoadScheme(this.drMySql.GetString("Scheme")); } this.drMySql.Close(); } catch (Exception ex) { this.ShowMessage("Problem loading the company details", "Error:" + ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } this.Cursor = Cursors.Default; } // Token: 0x0600005E RID: 94 RVA: 0x0000666C File Offset: 0x0000486C private void LoadStyle(string stylePath) { if (stylePath.Trim().Length > 0) { if (File.Exists(stylePath)) { this.imgStyle = Image.FromFile(stylePath); this.ShowPreview(); } else { this.imgStyle = null; this.ShowPreview(); } } else { this.imgStyle = null; this.ShowPreview(); } } // Token: 0x0600005F RID: 95 RVA: 0x000066D8 File Offset: 0x000048D8 private void LoadLogo(string logoPath) { if (logoPath.Trim().Length > 0) { if (File.Exists(logoPath)) { Image image = Image.FromFile(logoPath); this.imgLogo = frm.ScaleImage(image, 180, 60); this.ShowPreview(); } else { this.imgLogo = null; this.ShowPreview(); } } else { this.imgLogo = null; this.ShowPreview(); } } // Token: 0x06000060 RID: 96 RVA: 0x00006754 File Offset: 0x00004954 private int SaveCompanyDetails() { StringBuilder stringBuilder = new StringBuilder(); int num = 0; if (this.recordStatus == frm.operationMode.Add) { this.cmmMySql.CommandText = "SELECT IFNULL(MAX(ID) + 1, 1) FROM companies"; num = Convert.ToInt32(this.cmmMySql.ExecuteScalar()); this.cmmMySql.CommandText = string.Format("INSERT INTO companies SET ID = {0}", num); this.cmmMySql.ExecuteNonQuery(); } else if (this.recordStatus == frm.operationMode.Edit) { num = Convert.ToInt32(this.lvCompanies.SelectedItems[0].Text); } int result; try { this.Cursor = Cursors.WaitCursor; stringBuilder.AppendFormat("UPDATE companies SET Name = '{0}', ", this.txtCompanyName.Text); stringBuilder.AppendFormat("Email = '{0}', ", this.txtCompanyEmail.Text); stringBuilder.AppendFormat("Address = '{0}', ", this.txtCompanyAddress.Text); stringBuilder.AppendFormat("RegNo = '{0}', ", this.txtCompanyReg.Text); stringBuilder.AppendFormat("VATno ='{0}', ", this.txtCompanyVAT.Text); stringBuilder.AppendFormat("VATrate ='{0}', ", this.txtCompanyVatRate.Text); stringBuilder.AppendFormat("ContactNo = '{0}', ", this.txtCompanyContact.Text); stringBuilder.AppendFormat("AltNo = '{0}', ", this.txtCompanyAltNo.Text); stringBuilder.AppendFormat("LogoPath = '{0}', ", this.logoName); stringBuilder.AppendFormat("InvoiceStylePath = '{0}', ", this.styleName); stringBuilder.AppendFormat("InvoiceSize = '{0}', ", this.btnConfInvoiceSize.Text); stringBuilder.AppendFormat("BankingDetails = '{0}', ", this.txtBankingDetails.Text); int num2 = 0; this.FinYearStartMonth.TryGetValue(this.btnFinYearStartMonth.Text.Trim(), out num2); stringBuilder.AppendFormat("FinYearStartMonth = '{0}', ", num2.ToString("00")); if (this.IsMultiUserCompanyFromListView()) { stringBuilder.Append("IsMultiUser = 1, "); } else { stringBuilder.Append("IsMultiUser = 0, "); } stringBuilder.AppendFormat("Scheme = '{0}'", this.SchemeColor.ToString()); stringBuilder.AppendFormat(" WHERE ID = {0};\r\n", num); if (this.prevVatNumber.Length == 0 & this.txtCompanyVAT.Text.Length > 0) { stringBuilder.AppendFormat("UPDATE products SET VatRate = '{0}', ", this.txtCompanyVatRate.Text); stringBuilder.AppendFormat("SellingPrice = (SellingPriceIncl / (1 + ('{0}' / 100)));\r\n", this.txtCompanyVatRate.Text); } else if (this.prevVatNumber.Length > 0 & this.txtCompanyVAT.Text.Length == 0) { stringBuilder.Append("UPDATE products SET VatRate = '0', "); stringBuilder.Append("SellingPrice = SellingPriceIncl;\r\n"); } this.cmmMySql.CommandText = stringBuilder.ToString(); this.cmmMySql.ExecuteNonQuery(); this.Cursor = Cursors.Default; if (this.recordStatus == frm.operationMode.Add) { this.ShowNotification(this.txtCompanyName.Text + " was Added", "", frm.NotificationColor.Green); } else { this.ShowNotification(this.txtCompanyName.Text + " was Updated", "", frm.NotificationColor.Green); this.lvCompanies.SelectedItems[0].SubItems[1].Text = this.txtCompanyName.Text; if (this.currentCompanyID == Convert.ToInt32(this.lvCompanies.SelectedItems[0].Text)) { this.currentCompanyName = this.txtCompanyName.Text; this.lblMenuTitle.Text = this.currentCompanyName; this.currentScheme = this.lastLoadedScheme; } else { this.LoadScheme(this.currentScheme); } } result = num; } catch (Exception ex) { this.Cursor = Cursors.Default; string str = string.Empty; if (this.recordStatus == frm.operationMode.Add) { str = "adding "; } else { str = "updating "; } this.ShowMessage("Problem " + str + this.txtCompanyName.Text, "Error message: " + ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); this.SetButtonBarState(frm.btnBarStates.Companies); result = num; } return result; } // Token: 0x06000061 RID: 97 RVA: 0x00006C1C File Offset: 0x00004E1C private void lvCompanies_MouseDoubleClick(object sender, MouseEventArgs e) { if (this.changingCompany) { this.btnNext.PerformClick(); } else { this.btnEdit.PerformClick(); } } // Token: 0x06000062 RID: 98 RVA: 0x00006C58 File Offset: 0x00004E58 private void lvCompanies_SelectedIndexChanged(object sender, EventArgs e) { if (this.lvCompanies.SelectedItems.Count > 0) { this.btnEdit.Enabled = true; this.btnRemove.Enabled = true; } else { this.btnEdit.Enabled = false; this.btnRemove.Enabled = false; } } // Token: 0x06000063 RID: 99 RVA: 0x00006CBC File Offset: 0x00004EBC private void btnConfClearLogo_Click(object sender, EventArgs e) { try { this.picInvoicePreview.Image = null; this.logoName = string.Empty; this.imgLogo = null; if (File.Exists(this.stylesFolder + this.styleName)) { this.imgStyle = Image.FromFile(this.stylesFolder + this.styleName); } else { this.imgStyle = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "Resources\\DocStyles\\Samples\\_None.jpg"); } this.ShowPreview(); } catch (Exception ex) { this.ShowMessage("Problem clearing the logo", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } } // Token: 0x06000064 RID: 100 RVA: 0x00006D88 File Offset: 0x00004F88 private void btnAddLogo_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Logos"; openFileDialog.DefaultExt = ".jpg"; openFileDialog.Filter = "Pictures (.jpg, .bmp, .png)|*.jpg; *.bmp; *.png"; if (openFileDialog.ShowDialog() == DialogResult.OK) { this.btnClearLogo.PerformClick(); this.logoName = Path.GetFileName(openFileDialog.FileName); Image image = Image.FromFile(openFileDialog.FileName); this.imgLogo = frm.ScaleImage(image, 180, 60); this.ShowPreview(); try { this.Cursor = Cursors.WaitCursor; if (!File.Exists(openFileDialog.InitialDirectory + "\\" + this.logoName)) { File.Copy(openFileDialog.FileName, openFileDialog.InitialDirectory + "\\" + this.logoName, true); } } catch (Exception ex) { this.Cursor = Cursors.Default; this.ShowMessage("Problem copying logo to the Logos folder", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); } finally { this.Cursor = Cursors.Default; } } } } // Token: 0x06000065 RID: 101 RVA: 0x00006F20 File Offset: 0x00005120 private void btnClearStyle_Click(object sender, EventArgs e) { try { this.picInvoicePreview.Image = null; this.styleName = "_None.jpg"; this.imgStyle = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "Resources\\DocStyles\\Samples\\_None.jpg"); this.ShowPreview(); } catch (Exception ex) { this.ShowMessage("Problem resetting the style", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } } // Token: 0x06000066 RID: 102 RVA: 0x00006FA8 File Offset: 0x000051A8 private void btnAddStyle_Click(object sender, EventArgs e) { this.Rightflyout.flpStyles.Controls.Clear(); this.Rightflyout.Top = base.Top; this.Rightflyout.Left = base.Width + this.Rightflyout.Width; this.Rightflyout.Height = base.Height - 3; foreach (string text in Directory.GetFiles(this.stylesFolder + "\\Samples")) { Button button = new Button(); button.Anchor = AnchorStyles.None; button.FlatStyle = FlatStyle.Flat; button.FlatAppearance.MouseOverBackColor = Color.FromArgb(0, 130, 135); button.FlatAppearance.BorderSize = 0; button.Text = Path.GetFileNameWithoutExtension(text).Replace("_", " "); button.Font = new Font("Segoe UI", 11f); button.TextAlign = ContentAlignment.MiddleCenter; button.ForeColor = Color.White; button.BackColor = Color.FromArgb(1, 65, 81); button.Width = this.Rightflyout.flpStyles.Width - 5; button.Height = this.Rightflyout.flpStyles.Height - 40; using (Image image = Image.FromFile(text)) { button.Image = frm.ScaleImage(image, button.Width - 10, button.Height - 30); } button.TextImageRelation = TextImageRelation.TextAboveImage; button.Click += this.btnSelectedStyle_Click; this.Rightflyout.flpStyles.Controls.Add(button); } this.Rightflyout.flyOutReason = Flyout.Caller.ConfStyles; this.Rightflyout.tabFlyOut.SelectedTab = this.Rightflyout.pFlyOutStyles; this.Rightflyout.lblFlyOutHeading.Text = "Styles"; this.Rightflyout.btnOK.Visible = false; this.Rightflyout.Show(this); } // Token: 0x06000067 RID: 103 RVA: 0x000071F4 File Offset: 0x000053F4 private void btnSelectedStyle_Click(object sender, EventArgs e) { this.styleName = ((Button)sender).Text.Replace(" ", "_") + ".jpg"; this.imgStyle = Image.FromFile(this.stylesFolder + "\\Samples\\" + this.styleName); this.ShowPreview(); this.Rightflyout.Hide(); this.Rightflyout.flpStyles.Controls.Clear(); } // Token: 0x06000068 RID: 104 RVA: 0x00007278 File Offset: 0x00005478 private void btnFinYearStartMonth_Click(object sender, EventArgs e) { this.AddPopupButton(" January", string.Empty, 0, false, true); this.AddPopupButton(" February", string.Empty, 0, false, true); this.AddPopupButton(" March", string.Empty, 0, false, true); this.AddPopupButton(" April", string.Empty, 0, false, true); this.AddPopupButton(" May", string.Empty, 0, false, true); this.AddPopupButton(" June", string.Empty, 0, false, true); this.AddPopupButton(" July", string.Empty, 0, false, true); this.AddPopupButton(" August", string.Empty, 0, false, true); this.AddPopupButton(" September", string.Empty, 0, false, true); this.AddPopupButton(" October", string.Empty, 0, false, true); this.AddPopupButton(" November", string.Empty, 0, false, true); this.AddPopupButton(" December", string.Empty, 0, false, true); this.ShowPopup(this.btnFinYearStartMonth, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x06000069 RID: 105 RVA: 0x00007388 File Offset: 0x00005588 private void btnConfInvoiceSize_Click(object sender, EventArgs e) { this.AddPopupButton(" A4", string.Empty, 0, false, true); this.AddPopupButton(" A5", string.Empty, 0, false, true); this.AddPopupButton(" Slip", string.Empty, 0, false, true); this.ShowPopup(this.btnConfInvoiceSize, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x0600006A RID: 106 RVA: 0x000073E4 File Offset: 0x000055E4 private void btnConfInvoiceSize_TextChanged(object sender, EventArgs e) { if (this.btnConfInvoiceSize.Text.Contains("A4") | this.btnConfInvoiceSize.Text.Contains("A5")) { this.btnAddLogo.Visible = true; this.btnClearLogo.Visible = true; this.btnAddStyle.Visible = true; this.btnClearStyle.Visible = true; this.picInvoicePreview.Visible = true; this.lblInvoiceLogo.Visible = true; this.lblInvoiceStyle.Visible = true; if (this.styleName.Length == 0) { this.picInvoicePreview.ImageLocation = this.stylesFolder + "\\Samples\\_None.jpg"; } } else { this.btnAddLogo.Visible = false; this.btnClearLogo.Visible = false; this.btnAddStyle.Visible = false; this.btnClearStyle.Visible = false; this.picInvoicePreview.Visible = false; this.lblInvoiceLogo.Visible = false; this.lblInvoiceStyle.Visible = false; } this.btnConfSize_CashInvoice.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_Refund.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_Payout.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_AccInvoice.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_CreditNote.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_Receipt.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_Journal.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_Quotation.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_ProformaInvoice.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_IBT.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_IBTreturn.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_CashPurchase.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_CashPurchaseReturn.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_AccPurchase.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_DebitNote.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_CreditorJournal.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_Payment.Text = this.btnConfInvoiceSize.Text; this.btnConfSize_PurchaseOrder.Text = this.btnConfInvoiceSize.Text; } // Token: 0x0600006B RID: 107 RVA: 0x000076B4 File Offset: 0x000058B4 public static Bitmap ScaleImage(Image image, int maxWidth, int maxHeight) { double val = (double)maxWidth / (double)image.Width; double val2 = (double)maxHeight / (double)image.Height; double num = Math.Min(val, val2); int width = (int)((double)image.Width * num); int height = (int)((double)image.Height * num); Bitmap bitmap = new Bitmap(width, height); Graphics.FromImage(bitmap).DrawImage(image, 0, 0, width, height); Bitmap result = new Bitmap(bitmap); bitmap.Dispose(); return result; } // Token: 0x0600006C RID: 108 RVA: 0x00007730 File Offset: 0x00005930 private void ShowPreview() { if (this.imgStyle != null) { using (Graphics graphics = Graphics.FromImage(this.imgStyle)) { if (this.imgLogo != null) { graphics.DrawImage(this.imgLogo, new Point(45, 30)); } this.picInvoicePreview.Image = this.imgStyle; } } } // Token: 0x0600006D RID: 109 RVA: 0x000077B8 File Offset: 0x000059B8 private void txtCompanyVatRate_Leave(object sender, EventArgs e) { if (this.txtCompanyVatRate.Text.Length == 0) { this.txtCompanyVatRate.Text = "0"; } } // Token: 0x0600006E RID: 110 RVA: 0x000077F4 File Offset: 0x000059F4 private void txtCompanyVatRate_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '.') { if (this.txtCompanyVatRate.Text.Contains(".")) { e.Handled = true; } } else if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; } } // Token: 0x0600006F RID: 111 RVA: 0x00007866 File Offset: 0x00005A66 private void btnConfSchemeDefault_Click(object sender, EventArgs e) { this.LoadScheme("default"); } // Token: 0x06000070 RID: 112 RVA: 0x00007875 File Offset: 0x00005A75 private void btnConfSchemeBrown_Click(object sender, EventArgs e) { this.LoadScheme("brown"); } // Token: 0x06000071 RID: 113 RVA: 0x00007884 File Offset: 0x00005A84 private void btnConfSchemeBlue_Click(object sender, EventArgs e) { this.LoadScheme("blue"); } // Token: 0x06000072 RID: 114 RVA: 0x00007893 File Offset: 0x00005A93 private void btnConfSchemeGreen_Click(object sender, EventArgs e) { this.LoadScheme("green"); } // Token: 0x06000073 RID: 115 RVA: 0x000078A2 File Offset: 0x00005AA2 private void btnConfSchemeRed_Click(object sender, EventArgs e) { this.LoadScheme("red"); } // Token: 0x06000074 RID: 116 RVA: 0x000078B1 File Offset: 0x00005AB1 private void btnConfSchemePink_Click(object sender, EventArgs e) { this.LoadScheme("pink"); } // Token: 0x06000075 RID: 117 RVA: 0x000078C0 File Offset: 0x00005AC0 private void btnConfSchemeBonsai_Click(object sender, EventArgs e) { this.LoadScheme("bonsai"); } // Token: 0x06000076 RID: 118 RVA: 0x000078CF File Offset: 0x00005ACF private void btnConfSchemeBlack_Click(object sender, EventArgs e) { this.LoadScheme("black"); } // Token: 0x06000077 RID: 119 RVA: 0x000078E0 File Offset: 0x00005AE0 private void AddDefaultUsers() { try { this.lvConfUsers.Padding = new Padding(0, 0, this.vertScrollWidth, 0); this.lvConfUsers.Items.Clear(); string availablePrograms = this.GetAvailablePrograms(); this.lvConfUsers.BeginUpdate(); for (int i = 1; i <= 20; i++) { if (i == 1) { this.lvConfUsers.Items.Add("Manager"); } else { this.lvConfUsers.Items.Add("not in use"); } if (i == 1) { this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(string.Empty); } else { this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(availablePrograms); } this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(string.Empty); if (i == 1) { this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add("Manager"); } else { this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add("not in use"); } this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(string.Empty); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(i.ToString()); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(string.Empty); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(string.Empty); } this.lvConfUsers.EndUpdate(); } catch (Exception ex) { MessageBox.Show(ex.Message + '\n' + ex.StackTrace); } } // Token: 0x06000078 RID: 120 RVA: 0x00007BB8 File Offset: 0x00005DB8 private int LoadUsers(int companyID) { int num = 0; try { this.lvConfUsers.Items.Clear(); this.lvConfUsers.BeginUpdate(); this.cmmMySql.CommandText = string.Format("SELECT * FROM `users` WHERE CompanyID = {0}", companyID); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.lvConfUsers.Items.Add(this.drMySql.GetString("UserName")); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("ProgramsToUse")); if (this.drMySql.GetString("Password").Length >= 5) { this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("Password").Substring(0, 5)); } else { this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("Password")); } this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("UserName")); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("Password")); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("UserID")); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("PictureName")); this.lvConfUsers.Items[this.lvConfUsers.Items.Count - 1].SubItems.Add(this.drMySql.GetString("UserRights")); num++; } } else { this.AddDefaultUsers(); num = 20; } this.drMySql.Close(); this.lvConfUsers.EndUpdate(); } catch (Exception ex) { this.ShowMessage("Problem loading the Users from the database.", "Error Message: " + ex.Message, "", "Cancel", false, true, false, frm.MessageColor.Red); } return num; } // Token: 0x06000079 RID: 121 RVA: 0x00007EF4 File Offset: 0x000060F4 private void lvConfUsers_SelectedIndexChanged(object sender, EventArgs e) { if (this.lvConfUsers.SelectedItems.Count > 0) { this.btnProgramOptions.Visible = false; if (this.lvConfUsers.Items[0].Selected) { this.btnRemove.Visible = false; this.lblUserAvailablePrograms.Visible = false; this.lstConfUsersAvailablePrograms.Visible = false; } else { this.btnRemove.Visible = true; this.lblUserAvailablePrograms.Visible = true; this.lstConfUsersAvailablePrograms.Visible = true; } this.LoadSelectedUserDetails(); this.strFinalProgramOptions.Clear(); } } // Token: 0x0600007A RID: 122 RVA: 0x00007FB4 File Offset: 0x000061B4 private void LoadSelectedUserDetails() { try { if (this.lvConfUsers.SelectedItems.Count > 0) { this.preventItemCheckEvent = true; if (this.lvConfUsers.Items[0].Selected) { this.btnProgramOptions.Enabled = false; this.txtConfUserName.Text = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserName)].Text; this.txtConfUserPassword.Text = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text; for (int i = 0; i <= this.lstConfUsersAvailablePrograms.Items.Count - 1; i++) { this.lstConfUsersAvailablePrograms.SetItemChecked(i, true); } } else { this.btnProgramOptions.Enabled = true; this.txtConfUserName.Text = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserName)].Text; this.txtConfUserPassword.Text = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text; foreach (object obj in this.lstConfUsersAvailablePrograms.CheckedIndices) { int j = (int)obj; this.lstConfUsersAvailablePrograms.SetItemChecked(j, false); } string[] array = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cProgramsToUse)].Text.Split(new char[] { '|' }); for (int j = 0; j <= array.Length - 1; j++) { for (int i = 0; i <= this.lstConfUsersAvailablePrograms.Items.Count - 1; i++) { CheckedListBox.ObjectCollection items = this.lstConfUsersAvailablePrograms.Items; if ((string)items[i] == array[j]) { this.lstConfUsersAvailablePrograms.SetItemChecked(i, true); } } } this.ListAvailableUserRightsForPPOS(); this.LoadSelectedProgramOptions(); this.SelProgramOptions = frm.selProgramOptions.PPOS; this.UpdateSelectedProgramOptions(); this.ListAvailableUserRightsForInvoices(); this.LoadSelectedProgramOptions(); this.SelProgramOptions = frm.selProgramOptions.Invoices; this.UpdateSelectedProgramOptions(); this.ListAvailableUserRightsForPurchases(); this.LoadSelectedProgramOptions(); this.SelProgramOptions = frm.selProgramOptions.Purchases; this.UpdateSelectedProgramOptions(); } try { string str = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Pictures\\"; string text = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPicName)].Text; if (File.Exists(str + text)) { this.picUser.Image = new Bitmap(str + text); this.picUser.Tag = text; } else { this.picUser.Image = new Bitmap(str + "NoUser.png"); this.picUser.Tag = "NoUser.png"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { this.preventItemCheckEvent = false; } } // Token: 0x0600007B RID: 123 RVA: 0x00008450 File Offset: 0x00006650 private void txtConfUserName_Leave(object sender, EventArgs e) { this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserName)].Text = this.txtConfUserName.Text; } // Token: 0x0600007C RID: 124 RVA: 0x000084A0 File Offset: 0x000066A0 private void txtConfUserPassword_Leave(object sender, EventArgs e) { this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text = this.txtConfUserPassword.Text; } // Token: 0x0600007D RID: 125 RVA: 0x000084F0 File Offset: 0x000066F0 private void btnUserPicChange_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { string path = string.Empty; string text = string.Empty; string str = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Pictures\\"; openFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Pictures"; openFileDialog.DefaultExt = ".jpg"; openFileDialog.Filter = "Pictures (.jpg, .bmp, .png)|*.jpg; *.bmp; *.png"; if (openFileDialog.ShowDialog() == DialogResult.OK) { path = Path.GetFileName(openFileDialog.FileName); text = Path.GetFileName(path); this.picUser.Image = new Bitmap(str + text); this.picUser.Tag = text; this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPicName)].Text = text; } } } // Token: 0x0600007E RID: 126 RVA: 0x00008604 File Offset: 0x00006804 private void lstConfUsersAvailablePrograms_Click(object sender, EventArgs e) { if (this.lstConfUsersAvailablePrograms.SelectedItems.Count > 0) { if (this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString() == "PPOS") { this.btnProgramOptions.Text = this.txtConfUserName.Text + "'s rights for PPOS"; this.ListAvailableUserRightsForPPOS(); this.LoadSelectedProgramOptions(); this.SelProgramOptions = frm.selProgramOptions.PPOS; if (this.lstConfUsersAvailablePrograms.GetItemCheckState(this.lstConfUsersAvailablePrograms.SelectedIndex) == CheckState.Checked) { this.btnProgramOptions.Visible = true; } else { this.btnProgramOptions.Visible = false; } } else if (this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString() == "Sales") { this.btnProgramOptions.Text = this.txtConfUserName.Text + "'s rights for Sales"; this.ListAvailableUserRightsForInvoices(); this.LoadSelectedProgramOptions(); this.SelProgramOptions = frm.selProgramOptions.Invoices; if (this.lstConfUsersAvailablePrograms.GetItemCheckState(this.lstConfUsersAvailablePrograms.SelectedIndex) == CheckState.Checked) { this.btnProgramOptions.Visible = true; } else { this.btnProgramOptions.Visible = false; } } else if (this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString() == "Purchases") { this.btnProgramOptions.Text = this.txtConfUserName.Text + "'s rights for Purchases"; this.ListAvailableUserRightsForPurchases(); this.LoadSelectedProgramOptions(); this.SelProgramOptions = frm.selProgramOptions.Purchases; if (this.lstConfUsersAvailablePrograms.GetItemCheckState(this.lstConfUsersAvailablePrograms.SelectedIndex) == CheckState.Checked) { this.btnProgramOptions.Visible = true; } else { this.btnProgramOptions.Visible = false; } } else { this.btnProgramOptions.Visible = false; } } } // Token: 0x0600007F RID: 127 RVA: 0x0000882C File Offset: 0x00006A2C private void lstConfUsersAvailablePrograms_ItemCheck(object sender, ItemCheckEventArgs e) { if (!this.preventItemCheckEvent) { this.programsToUse.Clear(); if (this.lstConfUsersAvailablePrograms.SelectedItems.Count > 0) { for (int i = 0; i < this.lstConfUsersAvailablePrograms.Items.Count; i++) { if (i == e.Index) { if (e.NewValue == CheckState.Checked) { this.programsToUse.AppendFormat("{0}|", this.lstConfUsersAvailablePrograms.GetItemText(this.lstConfUsersAvailablePrograms.Items[i])); } } else if (this.lstConfUsersAvailablePrograms.GetItemCheckState(i) == CheckState.Checked) { this.programsToUse.AppendFormat("{0}|", this.lstConfUsersAvailablePrograms.GetItemText(this.lstConfUsersAvailablePrograms.Items[i])); } } this.lvConfUsers.SelectedItems[0].SubItems[this.cProgramsToUse.Index].Text = this.programsToUse.ToString(); this.btnProgramOptions.Visible = false; if (this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString() == "PPOS" | this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString() == "Sales" | this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString() == "Purchases") { if (e.CurrentValue == CheckState.Unchecked) { this.btnProgramOptions.Visible = true; } } } } } // Token: 0x06000080 RID: 128 RVA: 0x00008A04 File Offset: 0x00006C04 private void btnProgramOptions_Click(object sender, EventArgs e) { this.Rightflyout.Top = base.Top; this.Rightflyout.Left = base.Width + this.Rightflyout.Width; this.Rightflyout.Height = base.Height - 3; this.Rightflyout.flyOutReason = Flyout.Caller.UserDetails; this.Rightflyout.tabFlyOut.SelectedTab = this.Rightflyout.pFlyOutUserDetails; this.Rightflyout.lblFlyOutHeading.Text = "Rights for - " + this.lstConfUsersAvailablePrograms.SelectedItems[0].ToString(); this.Rightflyout.btnOK.Visible = true; this.Rightflyout.Show(this); } // Token: 0x06000081 RID: 129 RVA: 0x00008AD0 File Offset: 0x00006CD0 public void UpdateSelectedUserProgramsToUse() { string text = string.Empty; if (this.lstConfUsersAvailablePrograms.Items.Count > 0) { text = string.Empty; foreach (object obj in this.lstConfUsersAvailablePrograms.CheckedIndices) { int index = (int)obj; text = text + this.lstConfUsersAvailablePrograms.Items[index].ToString() + "|"; } } this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cProgramsToUse)].Text = text; } // Token: 0x06000082 RID: 130 RVA: 0x00008BC0 File Offset: 0x00006DC0 private void SaveAllUsers(int companyID) { try { this.Cursor = Cursors.WaitCursor; if (this.lvConfUsers.SelectedItems.Count > 0) { bool flag = true; this.UpdateSelectedUserProgramsToUse(); string text = string.Empty; for (int i = 1; i <= this.lvConfUsers.Items.Count - 1; i++) { if (string.Compare(this.lvConfUsers.Items[i].Text, "Not in Use", true) != 0 & this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text.Length == 0) { text += string.Format("{0},", this.lvConfUsers.Items[i].Text); flag = false; } } if (flag) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("DELETE FROM `users` WHERE CompanyID = {0};", companyID); string text2 = string.Empty; string arg = string.Empty; string text3 = string.Empty; int num = 0; for (int i = 0; i <= this.lvConfUsers.Items.Count - 1; i++) { if (i >= 1) { if (string.Compare(this.lvConfUsers.Items[i].Text, "not in use", true) != 0) { num++; } } stringBuilder.AppendFormat("INSERT INTO `users` SET UserName = '{0}', ", this.lvConfUsers.Items[i].Text); stringBuilder.AppendFormat("CompanyID = {0}, ", companyID); stringBuilder.AppendFormat("ProgramsToUse = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cProgramsToUse)].Text); stringBuilder.AppendFormat("UserRights = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserRights)].Text); text3 = this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cOldPassword)].Text; int length = this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cOldPassword)].Text.Length; text2 = this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text; int length2 = this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text.Length; if (length == 0) { if (length2 > 0) { using (MD5 md = MD5.Create()) { arg = Encryption128bit.GetMd5Hash(md, text2); } stringBuilder.AppendFormat("Password = '{0}', ", arg); } } else if (text2 != text3.Substring(0, 5)) { using (MD5 md = MD5.Create()) { arg = Encryption128bit.GetMd5Hash(md, text2); } stringBuilder.AppendFormat("Password = '{0}', ", arg); } else { stringBuilder.AppendFormat("Password = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cOldPassword)].Text); } stringBuilder.AppendFormat("PictureName = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPicName)].Text); stringBuilder.AppendFormat("UserID = {0};", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserID)].Text); } this.cmmMySql.CommandText = stringBuilder.ToString(); this.cmmMySql.ExecuteNonQuery(); if (companyID == this.currentCompanyID) { if (num > 0) { this.isMultiUser = true; } else { this.isMultiUser = false; } } this.Cursor = Cursors.Default; } else { this.Cursor = Cursors.Default; this.ShowMessage("Missing password(s)", "Please provide a password for the following user(s):\n" + text.TrimEnd(new char[] { ',' }) + ".", "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); } } } catch (Exception ex) { this.Cursor = Cursors.Default; if (this.ShowMessage("PPOS failed to update the changes.", "Error message: " + ex.Message + "\nWould you like to retry?", "&Yes", "&No", true, true, false, frm.MessageColor.Red) == frm.MessageReturn.Cancel) { this.SetButtonBarState(frm.btnBarStates.UserOptions); } } finally { this.strFinalProgramOptions.Clear(); this.dictPPOSOptions.Clear(); this.dictInvoicesOptions.Clear(); this.dictPurchasesOptions.Clear(); } } // Token: 0x06000083 RID: 131 RVA: 0x00009240 File Offset: 0x00007440 private void FillAvailableProgramsListBox() { try { if (this.lstConfUsersAvailablePrograms.Items.Count == 0) { string availablePrograms = this.GetAvailablePrograms(); string[] array = availablePrograms.Split(new char[] { '|' }); for (int i = 0; i <= array.Length - 1; i++) { if (array[i].Length > 0) { this.lstConfUsersAvailablePrograms.Items.Add(array[i]); } } } } catch (Exception ex) { MessageBox.Show(ex.Message + '\n' + ex.StackTrace); } } // Token: 0x06000084 RID: 132 RVA: 0x00009334 File Offset: 0x00007534 private string GetAvailablePrograms() { string result; try { StringBuilder stringBuilder = new StringBuilder(); string path = AppDomain.CurrentDomain.BaseDirectory + "Programs"; string[] files = Directory.GetFiles(path); IEnumerable enumerable = from file in files where file.EndsWith(".exe") || file.EndsWith(".lnk") select file; stringBuilder.Append("PPOS" + '|'); foreach (string path2 in enumerable) { stringBuilder.Append(Path.GetFileNameWithoutExtension(path2)); stringBuilder.Append('|'); } result = stringBuilder.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); result = string.Empty; } return result; } // Token: 0x06000085 RID: 133 RVA: 0x00009440 File Offset: 0x00007640 private void ListAvailableUserRightsForPPOS() { this.Rightflyout.lstConfUsersProgramOptions.Items.Clear(); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Do Configurations to this program"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Use Tools on Main Screen"); } // Token: 0x06000086 RID: 134 RVA: 0x0000949C File Offset: 0x0000769C private void ListAvailableUserRightsForInvoices() { this.Rightflyout.lstConfUsersProgramOptions.Items.Clear(); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Invoices - Access to Previous Transactions"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Invoices - Reprint last Transaction"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow to give Sales Discounts"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Sale Refunds"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Payouts"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Account Invoices"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Sale Credit Notes"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Account Payments from Clients"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Account Journals to Clients"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Quotations"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Proforma Invoices"); if (this.purchasesModuleExist) { this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Inter-branch Transfers (IBT`s)"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow IBT Returns"); } this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow to change selling prices"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Negative Qty`s in grid"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Manage Clients"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Manage Items on Invoices"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Change item`s description in sales grid"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Edit previous Invoices"); } // Token: 0x06000087 RID: 135 RVA: 0x000096D0 File Offset: 0x000078D0 private void ListAvailableUserRightsForPurchases() { this.Rightflyout.lstConfUsersProgramOptions.Items.Clear(); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Purchases - Access to Previous Transactions"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Purchases - Reprint last Transaction"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow to give purchase Discounts"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Purchases Returns"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Account Purchases"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Purchases Debit Notes"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Account Payments to Suppliers"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Account Journals to Suppliers"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Purchase Orders"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Allow Negative Qty`s in purchase grid"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Manage Suppliers"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Manage Items on Purchases"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Change item`s description in purchase grid"); this.Rightflyout.lstConfUsersProgramOptions.Items.Add("Edit previous Purchases"); } // Token: 0x06000088 RID: 136 RVA: 0x00009870 File Offset: 0x00007A70 private void LoadSelectedProgramOptions() { try { if (this.lvConfUsers.SelectedItems.Count > 0) { foreach (object obj in this.Rightflyout.lstConfUsersProgramOptions.CheckedIndices) { int i = (int)obj; this.Rightflyout.lstConfUsersProgramOptions.SetItemChecked(i, false); } string[] array = this.lvConfUsers.SelectedItems[0].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserRights)].Text.Split(new char[] { '|' }); for (int i = 0; i <= array.Length - 1; i++) { for (int j = 0; j <= this.Rightflyout.lstConfUsersProgramOptions.Items.Count - 1; j++) { CheckedListBox.ObjectCollection items = this.Rightflyout.lstConfUsersProgramOptions.Items; if ((string)items[j] == array[i]) { this.Rightflyout.lstConfUsersProgramOptions.SetItemChecked(j, true); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } // Token: 0x06000089 RID: 137 RVA: 0x00009A34 File Offset: 0x00007C34 public string UpdateSelectedProgramOptions() { if (this.SelProgramOptions == frm.selProgramOptions.PPOS) { this.dictPPOSOptions.Clear(); foreach (object obj in this.Rightflyout.lstConfUsersProgramOptions.CheckedIndices) { int index = (int)obj; this.dictPPOSOptions.Add(string.Format("{0}{1}", this.Rightflyout.lstConfUsersProgramOptions.Items[index].ToString(), "|"), true); } } else if (this.SelProgramOptions == frm.selProgramOptions.Invoices) { this.dictInvoicesOptions.Clear(); foreach (object obj2 in this.Rightflyout.lstConfUsersProgramOptions.CheckedIndices) { int index = (int)obj2; this.dictInvoicesOptions.Add(string.Format("{0}{1}", this.Rightflyout.lstConfUsersProgramOptions.Items[index].ToString(), "|"), true); } } else if (this.SelProgramOptions == frm.selProgramOptions.Purchases) { this.dictPurchasesOptions.Clear(); foreach (object obj3 in this.Rightflyout.lstConfUsersProgramOptions.CheckedIndices) { int index = (int)obj3; this.dictPurchasesOptions.Add(string.Format("{0}{1}", this.Rightflyout.lstConfUsersProgramOptions.Items[index].ToString(), "|"), true); } } foreach (KeyValuePair keyValuePair in this.dictPPOSOptions) { this.strFinalProgramOptions.AppendFormat("{0}{1}", keyValuePair.Key, "|"); } foreach (KeyValuePair keyValuePair in this.dictInvoicesOptions) { this.strFinalProgramOptions.AppendFormat("{0}{1}", keyValuePair.Key, "|"); } foreach (KeyValuePair keyValuePair in this.dictPurchasesOptions) { this.strFinalProgramOptions.AppendFormat("{0}{1}", keyValuePair.Key, "|"); } return this.strFinalProgramOptions.ToString(); } // Token: 0x0600008A RID: 138 RVA: 0x00009DC4 File Offset: 0x00007FC4 private void ClearConnectionDetails() { this.txtLoginUserName.Text = string.Empty; this.txtLoginPassword.Text = string.Empty; this.txtLoginIP.Text = string.Empty; this.txtLoginDatabaseName.Text = string.Empty; this.txtLoginPort.Text = string.Empty; } // Token: 0x0600008B RID: 139 RVA: 0x00009E28 File Offset: 0x00008028 private int ConnectToDatabase(string server, string port, string database, string username, string password) { string connectionString = string.Format("server={0};port={1};database={2};uid={3};pwd={4}", new object[] { server, port, database, username, password }); int result = -1; for (int i = 1; i <= 3; i++) { try { if (i > 1) { this.lblStartUpMsg.Text = string.Format("Connecting to the database - Attempt {0}. Please wait...", i); Application.DoEvents(); } if (this.cnnMySql.State == ConnectionState.Open) { this.cnnMySql.Close(); } this.cnnMySql.ConnectionString = connectionString; this.cnnMySql.Open(); this.cmmMySql.Connection = this.cnnMySql; result = 1; break; } catch (MySqlException ex) { if (ex.Number == 0 | ex.Number == 1045 | ex.Number == 1042) { result = ex.Number; break; } } } return result; } // Token: 0x0600008C RID: 140 RVA: 0x00009F64 File Offset: 0x00008164 private bool StartLocalServer(string arguments) { bool result = false; if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "DB32") && this.IsOriginalInstallationPC()) { if (!this.IsProcessRunning("mysqld")) { try { result = new Process { StartInfo = { FileName = AppDomain.CurrentDomain.BaseDirectory + "DB32\\bin\\ServerConsole.exe", Arguments = arguments } }.Start(); Thread.Sleep(5000); } catch (Exception ex) { this.ShowMessage("Failed starting the server (mysqld.exe).", "Error message: " + ex.Message, "", string.Empty, false, false, true, frm.MessageColor.Red); } } else { result = true; } } else { result = true; } return result; } // Token: 0x0600008D RID: 141 RVA: 0x0000A054 File Offset: 0x00008254 private int ConnectToLocalServer(string server, string username, string password, string database, string port, bool isPortable) { bool flag = this.StartLocalServer("1"); int result = -1; if (flag) { if (isPortable) { server = "localhost"; } result = this.ConnectToDatabase(server, port, database, username, password); } return result; } // Token: 0x0600008E RID: 142 RVA: 0x0000A0A0 File Offset: 0x000082A0 private int ConnectToOnlineServer(string server, string username, string password, string database, string port) { return this.ConnectToDatabase(server, port, database, username, password); } // Token: 0x0600008F RID: 143 RVA: 0x0000A0C0 File Offset: 0x000082C0 private void tConnectionStatus_Tick(object sender, EventArgs e) { try { if (this.isConnected) { this.cmmMySql.CommandText = "SELECT MIN(ID) FROM `users` WHERE ID >= 0"; string text = Convert.ToString(this.cmmMySql.ExecuteScalar()); } else { string connectionString = string.Format("server={0};port={1};database={2};uid={3};pwd={4}", new object[] { this.serverName, this.portName, this.databaseName, this.userName, this.passWord }); if (this.cnnMySql.State == ConnectionState.Open) { this.cnnMySql.Close(); } this.cnnMySql.ConnectionString = connectionString; this.cnnMySql.Open(); this.cmmMySql.Connection = this.cnnMySql; this.isConnected = true; this.FrmMessage.Hide(); this.frmMask.Hide(); } } catch (Exception) { if (!this.frmMask.Visible && base.WindowState != FormWindowState.Minimized) { this.ShowMessage("Connection with database is lost!", "Please check if the server is off, or if a network cable was unplugged.\nThis message will go away when then connection is restored, or click Close to quitPPOS", string.Empty, string.Empty, false, false, true, frm.MessageColor.Red); } this.isConnected = false; } } // Token: 0x06000090 RID: 144 RVA: 0x0000A214 File Offset: 0x00008414 private bool IsProcessRunning(string name) { bool flag = false; foreach (Process process in Process.GetProcesses()) { if (string.Compare(process.ProcessName, name, true) == 0) { flag = true; } } return flag; } // Token: 0x06000091 RID: 145 RVA: 0x0000A26C File Offset: 0x0000846C private void ShowConnectionErrorMessage(int result) { string subMessage = string.Empty; if (result == 0) { subMessage = "Check your username or password"; } else if (result == 1045) { subMessage = "Check the server name or IP address, database name or port #"; } else { subMessage = "Phone your service provider with this error #" + result.ToString(); } this.ShowMessage("Connection error.", subMessage, "&OK", string.Empty, true, false, true, frm.MessageColor.Red); } // Token: 0x06000092 RID: 146 RVA: 0x0000A2E0 File Offset: 0x000084E0 private void InitializeMessage() { this.frmMask.ShowInTaskbar = false; this.frmMask.Opacity = 0.6; this.frmMask.AllowTransparency = true; this.frmMask.FormBorderStyle = FormBorderStyle.None; this.frmMask.BackColor = Color.Black; this.frmMask.Width = 2; this.frmMask.Height = 2; this.frmMask.Show(); this.frmMask.Hide(); this.FrmMessage.ShowInTaskbar = false; this.FrmMessage.FormBorderStyle = FormBorderStyle.None; this.FrmMessage.BackColor = Color.Green; this.FrmMessage.Height = 260; this.FrmMessage.Controls.Add(this.tlpMessage); this.FrmMessage.StartPosition = FormStartPosition.CenterScreen; this.FrmMessage.KeyPreview = true; this.FrmMessage.KeyDown += this.frmMessage_KeyDown; this.tlpMessage.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); this.tlpMessage.ColumnCount = 8; this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 150f)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 5f)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 5f)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); this.tlpMessage.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); this.tlpMessage.Controls.Add(this.lblMessage, 1, 1); this.tlpMessage.Controls.Add(this.lblSubMessage, 1, 2); this.tlpMessage.Controls.Add(this.btnMessageOK, 2, 3); this.tlpMessage.Controls.Add(this.btnMessageCancel, 4, 3); this.tlpMessage.Controls.Add(this.btnMessageClose, 6, 3); this.tlpMessage.Name = "tlpMessage"; this.tlpMessage.RowCount = 5; this.tlpMessage.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f)); this.tlpMessage.RowStyles.Add(new RowStyle(SizeType.Percent, 50f)); this.tlpMessage.RowStyles.Add(new RowStyle(SizeType.Percent, 50f)); this.tlpMessage.RowStyles.Add(new RowStyle(SizeType.AutoSize)); this.tlpMessage.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f)); this.lblMessage.Anchor = AnchorStyles.Left; this.lblMessage.AutoSize = true; this.lblMessage.Font = new Font("Segoe UI", 20f); this.lblMessage.ForeColor = Color.WhiteSmoke; this.lblMessage.Location = new Point(123, 71); this.lblMessage.Size = new Size(139, 37); this.lblMessage.Text = string.Empty; this.lblSubMessage.Anchor = (AnchorStyles.Top | AnchorStyles.Left); this.lblSubMessage.AutoSize = true; this.tlpMessage.SetColumnSpan(this.lblSubMessage, 2); this.lblSubMessage.Font = new Font("Segoe UI", 11f); this.lblSubMessage.ForeColor = Color.WhiteSmoke; this.lblSubMessage.Location = new Point(123, 71); this.lblSubMessage.Size = new Size(139, 37); this.lblSubMessage.Text = string.Empty; this.lblSubMessage.Margin = new Padding(25, 0, 0, 0); this.btnMessageOK.Anchor = AnchorStyles.None; this.btnMessageOK.AutoSize = true; this.btnMessageOK.FlatStyle = FlatStyle.Flat; this.btnMessageOK.FlatAppearance.MouseOverBackColor = Color.DarkGray; this.btnMessageOK.FlatAppearance.BorderColor = Color.WhiteSmoke; this.btnMessageOK.FlatAppearance.BorderSize = 2; this.btnMessageOK.Text = "&OK"; this.btnMessageOK.Font = new Font("Segoe UI", 11f); this.btnMessageOK.TextAlign = ContentAlignment.MiddleCenter; this.btnMessageOK.ForeColor = Color.White; this.btnMessageOK.BackColor = Color.Gray; this.btnMessageOK.Width = 120; this.btnMessageOK.Height = 45; this.btnMessageOK.TabIndex = 0; this.btnMessageCancel.UseMnemonic = true; this.btnMessageOK.Click += this.btnMessageOK_Click; this.btnMessageCancel.Anchor = AnchorStyles.None; this.btnMessageCancel.AutoSize = true; this.btnMessageCancel.FlatStyle = FlatStyle.Flat; this.btnMessageCancel.FlatAppearance.MouseOverBackColor = Color.DarkGray; this.btnMessageCancel.FlatAppearance.BorderColor = Color.WhiteSmoke; this.btnMessageCancel.FlatAppearance.BorderSize = 2; this.btnMessageCancel.Text = "&Cancel"; this.btnMessageCancel.Font = new Font("Segoe UI", 11f); this.btnMessageCancel.TextAlign = ContentAlignment.MiddleCenter; this.btnMessageCancel.ForeColor = Color.White; this.btnMessageCancel.BackColor = Color.Gray; this.btnMessageCancel.Width = 120; this.btnMessageCancel.Height = 45; this.btnMessageCancel.TabIndex = 1; this.btnMessageCancel.UseMnemonic = true; this.btnMessageCancel.Click += this.btnMessageCancel_Click; this.btnMessageClose.Anchor = AnchorStyles.None; this.btnMessageClose.AutoSize = true; this.btnMessageClose.FlatStyle = FlatStyle.Flat; this.btnMessageClose.FlatAppearance.MouseOverBackColor = Color.DarkGray; this.btnMessageClose.FlatAppearance.BorderColor = Color.WhiteSmoke; this.btnMessageClose.FlatAppearance.BorderSize = 2; this.btnMessageClose.Text = "&Close"; this.btnMessageClose.Font = new Font("Segoe UI", 11f); this.btnMessageClose.TextAlign = ContentAlignment.MiddleCenter; this.btnMessageClose.ForeColor = Color.White; this.btnMessageClose.BackColor = Color.Gray; this.btnMessageClose.Width = 120; this.btnMessageClose.Height = 45; this.btnMessageClose.TabIndex = 2; this.btnMessageClose.UseMnemonic = true; this.btnMessageClose.Click += this.btnMessageClose_Click; } // Token: 0x06000093 RID: 147 RVA: 0x0000AA60 File Offset: 0x00008C60 public frm.MessageReturn ShowMessage(string message, string subMessage, string okButtonText, string cancelButtonText, bool okButtonVisible, bool cancelButtonVisible, bool closeButtonVissible, frm.MessageColor msgColor) { if (this.frmMask.Visible) { this.frmMask.Visible = false; } if (this.frmMask.Top != base.Top) { this.frmMask.Top = base.Top + 2; this.frmMask.Left = base.Left + 2; this.frmMask.Width = base.Width - 4; this.frmMask.Height = base.Height - 4; } this.frmMask.Show(this); this.FrmMessage.Width = base.Width; if (msgColor == frm.MessageColor.Green) { this.FrmMessage.BackColor = Color.FromArgb(0, 127, 36); } else if (msgColor == frm.MessageColor.Blue) { this.FrmMessage.BackColor = Color.FromArgb(14, 93, 178); } else if (msgColor == frm.MessageColor.Red) { this.FrmMessage.BackColor = Color.FromArgb(229, 0, 0); } this.lblMessage.Text = message; this.lblSubMessage.Text = subMessage; this.btnMessageOK.Text = okButtonText; this.btnMessageOK.Visible = okButtonVisible; this.btnMessageCancel.Text = cancelButtonText; this.btnMessageCancel.Visible = cancelButtonVisible; this.btnMessageClose.Visible = closeButtonVissible; this.FrmMessage.StartPosition = FormStartPosition.CenterScreen; this.FrmMessage.Height = 260; this.tlpMessage.Height = this.FrmMessage.Height; this.tlpMessage.Width = this.FrmMessage.Width; if (this.btnMessageOK.Visible) { this.btnMessageOK.Focus(); } else if (this.btnMessageCancel.Visible) { this.btnMessageCancel.Focus(); } else { this.btnMessageClose.Focus(); } this.FrmMessage.ShowDialog(this); frm.MessageReturn result; if (this.msgReturn == frm.MessageReturn.OK) { result = frm.MessageReturn.OK; } else if (this.msgReturn == frm.MessageReturn.Cancel) { result = frm.MessageReturn.Cancel; } else { result = frm.MessageReturn.NA; } return result; } // Token: 0x06000094 RID: 148 RVA: 0x0000ACCC File Offset: 0x00008ECC private void frmMessage_KeyDown(object sender, KeyEventArgs e) { Keys keyCode = e.KeyCode; if (keyCode == Keys.Escape) { this.msgReturn = frm.MessageReturn.NA; this.FrmMessage.Hide(); this.frmMask.Hide(); } } // Token: 0x06000095 RID: 149 RVA: 0x0000AD0E File Offset: 0x00008F0E private void btnMessageOK_Click(object sender, EventArgs e) { this.msgReturn = frm.MessageReturn.OK; this.FrmMessage.Hide(); this.frmMask.Hide(); } // Token: 0x06000096 RID: 150 RVA: 0x0000AD30 File Offset: 0x00008F30 private void btnMessageCancel_Click(object sender, EventArgs e) { this.msgReturn = frm.MessageReturn.Cancel; this.FrmMessage.Hide(); this.frmMask.Hide(); } // Token: 0x06000097 RID: 151 RVA: 0x0000AD52 File Offset: 0x00008F52 private void btnMessageClose_Click(object sender, EventArgs e) { this.FrmMessage.Close(); this.frmMask.Close(); this.frmPopupMenu.Close(); Application.Exit(); } // Token: 0x06000098 RID: 152 RVA: 0x0000AD80 File Offset: 0x00008F80 public frm() { this.InitializeComponent(); this.InitEnums(); base.WindowState = FormWindowState.Maximized; this.lblStartUp.Text = "Loading PPOS"; this.label17.Text = "Let's configure PPOS by clicking on the Next button..."; this.label14.Text = "Welcome to PPOS"; this.label23.Text = "Preparing PPOS"; this.label30.Text = "PPOS"; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; this.tabMain.SelectedTab = this.pStartUp; Application.DoEvents(); this.InitializeMessage(); this.InitializePopUp(); this.InitializeNotification(); this.InitializeBackup(); this.Rightflyout = new Flyout(this); this.tConnectionStatus.Tick += this.tConnectionStatus_Tick; SystemEvents.DisplaySettingsChanged += this.displaySettingsChanged; this.tHandelScreenRotation.Tick += this.tHandelScreenRotation_Tick; this.FinYearStartMonth.Add("January", 1); this.FinYearStartMonth.Add("February", 2); this.FinYearStartMonth.Add("March", 3); this.FinYearStartMonth.Add("April", 4); this.FinYearStartMonth.Add("May", 5); this.FinYearStartMonth.Add("June", 6); this.FinYearStartMonth.Add("July", 7); this.FinYearStartMonth.Add("August", 8); this.FinYearStartMonth.Add("September", 9); this.FinYearStartMonth.Add("October", 10); this.FinYearStartMonth.Add("November", 11); this.FinYearStartMonth.Add("December", 12); } // Token: 0x06000099 RID: 153 RVA: 0x0000B4E8 File Offset: 0x000096E8 private void Form1_Load(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; this.AdjustHeaderLabelSize(); if (!File.Exists(this.mainConfigurationFile)) { this.FirstTimeUseSetup = true; this.SetButtonBarState(frm.btnBarStates.Welcome); } else { this.OpenConfFromXML(); Application.DoEvents(); this.GetLicenceStatus(); if (this.licenceResult == frm.licenceVal.OK) { this.ContinueLoadingProgram(); int days = (this.dateFromXml.Date - DateTime.Now.Date).Days; if (days < 0) { this.Rightflyout.hideFlyout = false; if (this.ShowMessage("Licence expired", "Would you like to renew your annual licence?", "Yes", string.Empty, true, false, true, frm.MessageColor.Blue) == frm.MessageReturn.OK) { this.ShowLicenceScreen(true, true); } } else if (days == 0) { this.Rightflyout.hideFlyout = false; if (this.ShowMessage("Licence expires today!", "Would you like to renew your annual licence?", "Yes", "No", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { this.ShowLicenceScreen(false, false); } } else if (days == 1) { this.Rightflyout.hideFlyout = false; if (this.ShowMessage("Licence expires tomorrow!", "Would you like to renew your annual licence?", "Yes", "No", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { this.ShowLicenceScreen(false, false); } } else if (days > 1 && days <= 5) { this.Rightflyout.hideFlyout = false; if (this.ShowMessage(days.ToString() + " days left", "Would you like to renew your annual licence?", "Yes", "No", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { this.ShowLicenceScreen(false, false); this.Rightflyout.Activate(); } } } else if (this.licenceResult == frm.licenceVal.LicenceFileMissing) { if (this.ShowMessage("Activate licence", "Your licence need to be activated before you can proceed", "OK", string.Empty, true, false, true, frm.MessageColor.Red) == frm.MessageReturn.OK) { this.ShowLicenceScreen(true, true); } } } this.Cursor = Cursors.Default; } // Token: 0x0600009A RID: 154 RVA: 0x0000B734 File Offset: 0x00009934 private void Form1_Shown(object sender, EventArgs e) { if (this.tabMain.SelectedTab == this.pConnectionLogin) { this.txtLoginUserName.Focus(); } } // Token: 0x0600009B RID: 155 RVA: 0x0000B76C File Offset: 0x0000996C private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (base.WindowState == FormWindowState.Minimized) { base.WindowState = FormWindowState.Maximized; } if (e.CloseReason == CloseReason.UserClosing) { string str = string.Empty; if (!this.FirstTimeUseSetup) { str = " and any relevant programs.\nDo you want to continue?"; } if (this.ShowMessage("Close PPOS", "This will close PPOS" + str, "&Yes", "&No", true, true, false, frm.MessageColor.Green) == frm.MessageReturn.OK) { this.CloseOpenPrograms(); if (!this.frmMask.IsDisposed) { this.frmMask.Close(); } if (!this.FrmMessage.IsDisposed) { this.FrmMessage.Close(); } if (!this.frmPopupMenu.IsDisposed) { this.frmPopupMenu.Close(); } } else { e.Cancel = true; } } else { this.CloseOpenPrograms(); if (!this.frmMask.IsDisposed) { this.frmMask.Close(); } if (!this.FrmMessage.IsDisposed) { this.FrmMessage.Close(); } if (!this.frmPopupMenu.IsDisposed) { this.frmPopupMenu.Close(); } } } // Token: 0x0600009C RID: 156 RVA: 0x0000B8C0 File Offset: 0x00009AC0 private void Form1_Activated(object sender, EventArgs e) { if (this.Rightflyout.Visible & this.Rightflyout.hideFlyout) { this.Rightflyout.Hide(); } if (this.frmPopupMenu.Visible) { this.frmPopupMenu.Visible = false; } } // Token: 0x0600009D RID: 157 RVA: 0x0000B91C File Offset: 0x00009B1C private void Form1_KeyDown(object sender, KeyEventArgs e) { Keys keyCode = e.KeyCode; if (keyCode != Keys.Return) { if (keyCode == Keys.Escape) { this.btnPrevious.PerformClick(); } } else if (this.tabMain.SelectedTab == this.pUserLogin && this.txtUserLogin_Password.Focused) { this.btnNext.PerformClick(); } } // Token: 0x0600009E RID: 158 RVA: 0x0000B990 File Offset: 0x00009B90 private void frmFilterChars_KeyPress(object sender, KeyPressEventArgs e) { char keyChar = e.KeyChar; if (keyChar == ',') { e.KeyChar = '.'; e.Handled = false; } else if (keyChar == '\'') { e.KeyChar = '`'; e.Handled = false; } else if (keyChar == '\\') { e.KeyChar = '/'; e.Handled = false; } } // Token: 0x0600009F RID: 159 RVA: 0x0000BA08 File Offset: 0x00009C08 public void ContinueLoadingProgram() { this.lblStartUpMsg.Text = "Connecting to the database. Please wait..."; Application.DoEvents(); bool flag = false; if (this.databaseType == frm.dbType.local) { int num = this.ConnectToLocalServer(this.serverName, this.userName, this.passWord, this.databaseName, this.portName, this.isPortable); if (num == 1) { flag = true; } else { string currentIP = this.GetCurrentIP(); num = this.ConnectToLocalServer(currentIP, this.userName, this.passWord, this.databaseName, this.portName, this.isPortable); if (num == 1) { flag = true; this.serverName = currentIP; } } } else if (this.ConnectToOnlineServer(this.serverName, this.userName, this.passWord, this.databaseName, this.portName) == 1) { flag = true; } if (flag) { this.isConnected = true; this.lblStartUpMsg.Text = "Updating the database..."; Application.DoEvents(); this.InitDatabaseUpdate(); this.cmmMySql.CommandText = string.Format("SELECT c.Name, c.ID, c.Scheme FROM companies c, workstation_state w WHERE c.ID = w.CompanyID AND (w.ComputerName = '{0}' OR w.ComputerIP = '{1}')", this.GetComputerName(), this.GetCurrentIP()); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { this.drMySql.Read(); this.currentCompanyName = this.drMySql.GetString("Name"); this.currentCompanyID = (int)this.drMySql.GetInt16("ID"); this.LoadScheme(this.drMySql.GetString("Scheme")); this.currentScheme = this.lastLoadedScheme; } this.drMySql.Close(); this.cmmMySql.CommandText = string.Format("SELECT IsPortableDatabase FROM programs_config WHERE CompanyID = {0}", this.currentCompanyID); this.chkIsPortableDatabase.Checked = Convert.ToBoolean(this.cmmMySql.ExecuteScalar()); if (this.IsMultiUserCompanyFromDB()) { this.isMultiUser = true; this.ShowUserLoginScreen(); } else { this.FinalizeProgramLoading(); } } else if (this.ShowMessage("Can't connect", "There was a problem connecting with the last settings.\nWould you like to connect with different settings?", "&Yes", "&No", true, true, false, frm.MessageColor.Blue) == frm.MessageReturn.OK) { this.txtLoginUserName.Text = this.userName; this.txtLoginPassword.Text = this.passWord; this.txtLoginIP.Text = this.serverName; this.txtLoginDatabaseName.Text = this.databaseName; this.txtLoginPort.Text = this.portName; this.SetButtonBarState(frm.btnBarStates.Login); } else { this.CloseOpenPrograms(); this.frmPopupMenu.Close(); this.FrmMessage.Close(); this.frmMask.Close(); Application.Exit(); } } // Token: 0x060000A0 RID: 160 RVA: 0x0000BD04 File Offset: 0x00009F04 private bool IsMultiUserCompanyFromDB() { this.cmmMySql.CommandText = string.Format("SELECT IsMultiUser FROM companies WHERE ID = {0}", this.currentCompanyID); return Convert.ToBoolean(this.cmmMySql.ExecuteScalar()); } // Token: 0x060000A1 RID: 161 RVA: 0x0000BD48 File Offset: 0x00009F48 private void FinalizeProgramLoading() { this.Cursor = Cursors.WaitCursor; this.lblStartUpMsg.Text = "Preparing the menu..."; Application.DoEvents(); this.CreateButtonMenu(); this.SaveConfToXML(); this.tConnectionStatus.Interval = 5000; this.tConnectionStatus.Start(); this.SetButtonBarState(frm.btnBarStates.MainMenu); this.cmmMySql.CommandText = "SELECT IFNULL(ID, 0) FROM companies WHERE Name = '" + this.currentCompanyName + "' AND `Status` = 'Active'"; if (Convert.ToInt32(this.cmmMySql.ExecuteScalar()) == 0) { this.ShowMessage("The last company used no longer exist.", "Please choose another company to do transactions on.", "OK", string.Empty, true, false, false, frm.MessageColor.Blue); this.LoadCompanies(); this.SetButtonBarState(frm.btnBarStates.ChangeCompany); this.changingCompany = true; } this.Cursor = Cursors.Default; } // Token: 0x060000A2 RID: 162 RVA: 0x0000BE2C File Offset: 0x0000A02C private void displaySettingsChanged(object sender, EventArgs e) { this.tHandelScreenRotation.Interval = 200; this.tHandelScreenRotation.Start(); } // Token: 0x060000A3 RID: 163 RVA: 0x0000BE4C File Offset: 0x0000A04C private void tHandelScreenRotation_Tick(object sender, EventArgs e) { this.tHandelScreenRotation.Stop(); base.Size = Screen.PrimaryScreen.WorkingArea.Size; base.Top = Screen.PrimaryScreen.WorkingArea.Top; if (this.Rightflyout.Visible) { this.Rightflyout.Left = base.Width - this.Rightflyout.Width; this.Rightflyout.Height = base.Height - 7; } this.AdjustHeaderLabelSize(); } // Token: 0x060000A4 RID: 164 RVA: 0x0000BEE8 File Offset: 0x0000A0E8 protected override void WndProc(ref Message m) { int msg = m.Msg; if (msg == 274) { int num = m.WParam.ToInt32() & 65520; if (num == 61456) { return; } } base.WndProc(ref m); } // Token: 0x060000A5 RID: 165 RVA: 0x0000BF5C File Offset: 0x0000A15C private void CloseOpenPrograms() { string path = AppDomain.CurrentDomain.BaseDirectory + "Programs"; string[] files = Directory.GetFiles(path); IEnumerable enumerable = from file in files where file.EndsWith(".exe") select file; foreach (string path2 in enumerable) { foreach (Process process in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(path2))) { process.CloseMainWindow(); } } if (this.chkIsPortableDatabase.Checked & !this.changingCompany) { Process[] processesByName = Process.GetProcessesByName("mysqld"); foreach (Process process in processesByName) { Experiments.StopProgramByAttachingToItsConsoleAndIssuingCtrlCEvent(process); } Process[] processesByName2 = Process.GetProcessesByName("ServerConsole"); foreach (Process process in processesByName2) { process.Kill(); } } } // Token: 0x060000A6 RID: 166 RVA: 0x0000C0C4 File Offset: 0x0000A2C4 private void AdjustHeaderLabelSize() { if (base.Width < 1024) { this.lblMenuTitle.Font = new Font("Segoe UI Light", 16f); } else { this.lblMenuTitle.Font = new Font("Segoe UI Light", 42f); } } // Token: 0x060000A7 RID: 167 RVA: 0x0000C124 File Offset: 0x0000A324 private void frm_SizeChanged(object sender, EventArgs e) { if (this.Rightflyout != null && this.Rightflyout.Visible) { this.Rightflyout.Height = base.Height - 7; } } // Token: 0x060000A8 RID: 168 RVA: 0x0000C168 File Offset: 0x0000A368 private string IsNetworkConnected() { bool isNetworkAvailable = NetworkInterface.GetIsNetworkAvailable(); string result; if (isNetworkAvailable) { result = "Connected"; } else { result = "Not connected"; } return result; } // Token: 0x060000A9 RID: 169 RVA: 0x0000C1E0 File Offset: 0x0000A3E0 public string GetCurrentIP() { IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName()); return (from addr in hostEntry.AddressList where addr.AddressFamily.ToString() == "InterNetwork" select addr.ToString()).FirstOrDefault(); } // Token: 0x060000AA RID: 170 RVA: 0x0000C250 File Offset: 0x0000A450 public string GetComputerName() { return Environment.MachineName; } // Token: 0x060000AB RID: 171 RVA: 0x0000C268 File Offset: 0x0000A468 public bool IsOriginalInstallationPC() { string text = Environment.CommandLine.ToString().Replace("\"", "").Trim(); string text2 = new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath.Replace("/", "\\"); string text3 = text2.Replace("%20", " ").Trim(); return text.Length == text3.Length; } // Token: 0x060000AC RID: 172 RVA: 0x0000C2E4 File Offset: 0x0000A4E4 private void ReadLicenceXmlFile() { using (XmlTextReader xmlTextReader = new XmlTextReader(this.licenceFileName)) { while (xmlTextReader.Read()) { if (xmlTextReader.NodeType == XmlNodeType.Element && xmlTextReader.Name == "date") { this.dateFromXml = Convert.ToDateTime(this.UnScrambleDate(xmlTextReader.ReadString())); } } xmlTextReader.Close(); } } // Token: 0x060000AD RID: 173 RVA: 0x0000C374 File Offset: 0x0000A574 private void UpdateLicenceXmlFile(DateTime date) { this.Cursor = Cursors.WaitCursor; if (File.Exists(this.licenceFileName)) { File.Delete(this.licenceFileName); } using (XmlTextWriter xmlTextWriter = new XmlTextWriter(this.licenceFileName, null)) { xmlTextWriter.Formatting = Formatting.Indented; xmlTextWriter.WriteStartDocument(); xmlTextWriter.WriteStartElement("Licence"); xmlTextWriter.WriteElementString("date", this.ScrambleDate(date)); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteEndDocument(); xmlTextWriter.Flush(); xmlTextWriter.Close(); if (File.GetAttributes(this.licenceFileName) != FileAttributes.Hidden) { File.SetAttributes(this.licenceFileName, FileAttributes.Hidden); } } this.Cursor = Cursors.Default; } // Token: 0x060000AE RID: 174 RVA: 0x0000C458 File Offset: 0x0000A658 public string GenerateRegistrationCode() { string text = DateTime.Now.ToString("yyyy"); string text2 = DateTime.Now.ToString("MMM"); int weekOfYear = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(DateTime.Now, CalendarWeekRule.FirstDay, DayOfWeek.Monday); decimal num = (int)(text[0] + text[1]); decimal num2 = (int)(text[2] + text[3]); decimal num3 = text2[0]; decimal num4 = text2[1]; decimal num5 = text2[2]; decimal d = weekOfYear; if (d < 10m) { d = 10m; } return string.Concat(new string[] { num.ToString().Substring(0, 2).Replace("0", "1"), num2.ToString().Substring(0, 2).Replace("0", "1"), "-", num3.ToString().Substring(0, 2).Replace("0", "1"), num4.ToString().Substring(0, 2).Replace("0", "1"), "-", num5.ToString().Substring(0, 2).Replace("0", "1"), d.ToString().Substring(0, 2).Replace("0", "1") }); } // Token: 0x060000AF RID: 175 RVA: 0x0000C614 File Offset: 0x0000A814 private string ScrambleDate(DateTime date) { string text = date.ToString(" HH:mm:ss tt"); string text2 = date.ToString("yyyyMMdd"); decimal num = text2[0]; decimal num2 = text2[1]; decimal num3 = text2[2]; decimal num4 = text2[3]; decimal num5 = text2[4]; decimal num6 = text2[5]; decimal num7 = text2[6]; decimal num8 = text2[7]; return string.Concat(new string[] { num.ToString(), num2.ToString(), num3.ToString(), num4.ToString(), num5.ToString(), num6.ToString(), num7.ToString(), num8.ToString(), text }); } // Token: 0x060000B0 RID: 176 RVA: 0x0000C720 File Offset: 0x0000A920 private string UnScrambleDate(string date) { string text = date.Substring(0, 16); string text2 = date.Substring(16, date.Length - 16); int value = int.Parse(text.Substring(0, 2)); int value2 = int.Parse(text.Substring(2, 2)); int value3 = int.Parse(text.Substring(4, 2)); int value4 = int.Parse(text.Substring(6, 2)); int value5 = int.Parse(text.Substring(8, 2)); int value6 = int.Parse(text.Substring(10, 2)); int value7 = int.Parse(text.Substring(12, 2)); int value8 = int.Parse(text.Substring(14, 2)); char c = Convert.ToChar(value); char c2 = Convert.ToChar(value2); char c3 = Convert.ToChar(value3); char c4 = Convert.ToChar(value4); char c5 = Convert.ToChar(value5); char c6 = Convert.ToChar(value6); char c7 = Convert.ToChar(value7); char c8 = Convert.ToChar(value8); return string.Concat(new string[] { c.ToString(), c2.ToString(), c3.ToString(), c4.ToString(), "/", c5.ToString(), c6.ToString(), "/", c7.ToString(), c8.ToString(), text2 }); } // Token: 0x060000B1 RID: 177 RVA: 0x0000C890 File Offset: 0x0000AA90 private string ReverseActivationCode(string actGrp1, string actGrp2, string actGrp3) { string value = actGrp1 + actGrp2 + actGrp3; char[] array = (Convert.ToDecimal(value) - Convert.ToDecimal(DateTime.Now.ToString("yyyyMM") + "7601")).ToString().ToCharArray(); Array.Reverse(array); return new string(array); } // Token: 0x060000B2 RID: 178 RVA: 0x0000C8F4 File Offset: 0x0000AAF4 private void GetLicenceStatus() { if (File.Exists(this.licenceFileName)) { this.ReadLicenceXmlFile(); this.licenceResult = frm.licenceVal.OK; } else { this.licenceResult = frm.licenceVal.LicenceFileMissing; } } // Token: 0x060000B3 RID: 179 RVA: 0x0000C930 File Offset: 0x0000AB30 public string RenewLicence() { string result = string.Empty; string a = this.Rightflyout.txtFlyOutLicenceKey.Text + this.Rightflyout.txtFlyOutLicenceKey2.Text + this.Rightflyout.txtFlyOutLicenceKey3.Text; if (a == this.Rightflyout.lblFlyOutLicenceRegCode.Text.Replace("-", "")) { TimeSpan value = new TimeSpan(365 * 100, 0, 0, 0); DateTime date = DateTime.Now.Add(value); try { this.UpdateLicenceXmlFile(date); this.dateFromXml = date; } catch (Exception ex) { result = ex.Message; } } else { result = "The activation code is not correct.\nPlease provide another code then try again."; } return result; } // Token: 0x060000B4 RID: 180 RVA: 0x0000CA10 File Offset: 0x0000AC10 private void btnRenewLicence_Click(object sender, EventArgs e) { this.ShowLicenceScreen(false, false); } // Token: 0x060000B5 RID: 181 RVA: 0x0000CA1C File Offset: 0x0000AC1C public void Activate30DayTrail() { TimeSpan value = new TimeSpan(365*100, 0, 0, 0); DateTime date = DateTime.Now.Add(value); this.UpdateLicenceXmlFile(date); this.dateFromXml = date; } // Token: 0x060000B6 RID: 182 RVA: 0x0000CA58 File Offset: 0x0000AC58 private void ShowLicenceScreen(bool showBtnClose, bool showDialog) { this.Rightflyout.Top = base.Top; this.Rightflyout.Left = base.Width + this.Rightflyout.Width; this.Rightflyout.Height = base.Height - 3; this.Rightflyout.lblFlyOutLicenceRegCode.Text = this.GenerateRegistrationCode(); this.Rightflyout.btnFlyOutLicenceClose.Visible = showBtnClose; this.Rightflyout.txtFlyOutLicenceKey.Text = string.Empty; this.Rightflyout.txtFlyOutLicenceKey2.Text = string.Empty; this.Rightflyout.txtFlyOutLicenceKey3.Text = string.Empty; this.Rightflyout.flyOutReason = Flyout.Caller.Licence; this.Rightflyout.tabFlyOut.SelectedTab = this.Rightflyout.pFlyOutLicence; this.Rightflyout.lblFlyOutHeading.Text = "Activate/Renew Licence"; this.Rightflyout.btnOK.Visible = true; if (showDialog) { this.Rightflyout.ShowDialog(this); } else { this.Rightflyout.Show(this); } this.Rightflyout.Activate(); } // Token: 0x060000B7 RID: 183 RVA: 0x0000CB99 File Offset: 0x0000AD99 public void InitEnums() { this.dictAfterAddingItemToGrid.Add(frm.AfterAddingItemToGrid.NewLine, "Goto a new line"); this.dictAfterAddingItemToGrid.Add(frm.AfterAddingItemToGrid.QtyColumn, "Goto the Qty column"); this.dictAfterAddingItemToGrid.Add(frm.AfterAddingItemToGrid.PriceColumn, "Goto the Price column"); } // Token: 0x060000B8 RID: 184 RVA: 0x0000CBD4 File Offset: 0x0000ADD4 private void FinalizeFirstTimeConfiguration() { this.Cursor = Cursors.WaitCursor; if (this.optDatabaseLocal.Checked) { this.databaseType = frm.dbType.local; } else { this.databaseType = frm.dbType.online; } if (this.IsMultiUserCompanyFromListView()) { this.isMultiUser = true; } else { this.isMultiUser = false; } this.AddCompanyToDB(); this.AddUsersToDB(); this.SaveConfToXML(); this.SaveConfiguration(true, this.currentCompanyID); if (this.isMultiUser) { this.ShowUserLoginScreen(); } else { this.CreateButtonMenu(); this.SetButtonBarState(frm.btnBarStates.MainMenu); } this.FirstTimeUseSetup = false; this.Activate30DayTrail(); this.Cursor = Cursors.Default; } // Token: 0x060000B9 RID: 185 RVA: 0x0000CC9C File Offset: 0x0000AE9C private bool IsMultiUserCompanyFromListView() { int num = 0; for (int i = 0; i <= this.lvConfUsers.Items.Count - 1; i++) { if (i >= 1) { if (string.Compare(this.lvConfUsers.Items[i].Text, "not in use", true) != 0) { num++; } } } return num > 0; } // Token: 0x060000BA RID: 186 RVA: 0x0000CD14 File Offset: 0x0000AF14 private string AddCompanyToDB() { string result; try { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("INSERT INTO companies SET Name = '{0}', ", this.txtCompanyName.Text); stringBuilder.AppendFormat("Email = '{0}', ", this.txtCompanyEmail.Text); stringBuilder.AppendFormat("Address = '{0}', ", this.txtCompanyAddress.Text); stringBuilder.AppendFormat("RegNo = '{0}', ", this.txtCompanyReg.Text); stringBuilder.AppendFormat("VATno = '{0}', ", this.txtCompanyVAT.Text); stringBuilder.AppendFormat("VATrate ='{0}', ", this.txtCompanyVatRate.Text); stringBuilder.AppendFormat("ContactNo = '{0}', ", this.txtCompanyContact.Text); stringBuilder.AppendFormat("AltNo = '{0}', ", this.txtCompanyAltNo.Text); stringBuilder.AppendFormat("LogoPath = '{0}', ", this.logoName); stringBuilder.AppendFormat("InvoiceStylePath = '{0}', ", this.styleName); stringBuilder.AppendFormat("InvoiceSize = '{0}', ", this.btnConfInvoiceSize.Text); stringBuilder.AppendFormat("BankingDetails = '{0}', ", this.txtBankingDetails.Text); if (this.isMultiUser) { stringBuilder.Append("IsMultiUser = 1, "); } int num = 0; this.FinYearStartMonth.TryGetValue(this.btnFinYearStartMonth.Text.Trim(), out num); stringBuilder.AppendFormat("FinYearStartMonth = '{0}'", num.ToString("00")); this.cmmMySql.CommandText = stringBuilder.ToString(); this.cmmMySql.ExecuteNonQuery(); this.cmmMySql.CommandText = "SELECT LAST_INSERT_ID()"; int num2 = Convert.ToInt32(this.cmmMySql.ExecuteScalar()); this.currentCompanyName = this.txtCompanyName.Text; this.lblMenuTitle.Text = this.currentCompanyName; this.currentCompanyID = num2; result = string.Empty; } catch (Exception ex) { result = ex.Message; } return result; } // Token: 0x060000BB RID: 187 RVA: 0x0000CF30 File Offset: 0x0000B130 private string AddUsersToDB() { string result; try { if (this.isMultiUser) { StringBuilder stringBuilder = new StringBuilder(); string input = string.Empty; string arg = string.Empty; stringBuilder.AppendFormat("DELETE FROM `users` WHERE CompanyID = {0};", this.currentCompanyID); for (int i = 0; i <= this.lvConfUsers.Items.Count - 1; i++) { stringBuilder.AppendFormat("INSERT INTO `users` SET UserName = '{0}', ", this.lvConfUsers.Items[i].Text); stringBuilder.AppendFormat("CompanyID = {0}, ", this.currentCompanyID); stringBuilder.AppendFormat("ProgramsToUse = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cProgramsToUse)].Text); stringBuilder.AppendFormat("UserRights = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserRights)].Text); input = this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPassword)].Text; using (MD5 md = MD5.Create()) { arg = Encryption128bit.GetMd5Hash(md, input); } stringBuilder.AppendFormat("Password = '{0}', ", arg); stringBuilder.AppendFormat("PictureName = '{0}', ", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cPicName)].Text); stringBuilder.AppendFormat("UserID = {0};", this.lvConfUsers.Items[i].SubItems[this.lvConfUsers.Columns.IndexOf(this.cUserID)].Text); } this.cmmMySql.CommandText = stringBuilder.ToString(); this.cmmMySql.ExecuteNonQuery(); } result = string.Empty; } catch (Exception ex) { result = ex.Message; } return result; } // Token: 0x060000BC RID: 188 RVA: 0x0000D1D4 File Offset: 0x0000B3D4 private void OpenConfFromXML() { try { if (File.Exists(this.mainConfigurationFile)) { using (XmlTextReader xmlTextReader = new XmlTextReader(this.mainConfigurationFile)) { while (xmlTextReader.Read()) { if (xmlTextReader.NodeType == XmlNodeType.Element) { if (string.Compare(xmlTextReader.Name, "is_portable", true) == 0) { if (string.Compare(xmlTextReader.ReadString(), "true", true) == 0) { this.isPortable = true; } } else if (string.Compare(xmlTextReader.Name, "ip", true) == 0) { this.serverName = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "user_name", true) == 0) { this.userName = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "database_name", true) == 0) { this.databaseName = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "port_name", true) == 0) { this.portName = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "password", true) == 0) { this.passWord = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "lastCompanyID", true) == 0) { this.currentCompanyID = Convert.ToInt32(xmlTextReader.ReadString()); } else if (string.Compare(xmlTextReader.Name, "lastCompanyName", true) == 0) { this.currentCompanyName = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "lastBackupFolder", true) == 0) { this.lastBackupFolder = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "dbType", true) == 0) { if (string.Compare(xmlTextReader.ReadString(), "local", true) == 0) { this.databaseType = frm.dbType.local; } else { this.databaseType = frm.dbType.online; } } else if (string.Compare(xmlTextReader.Name, "scheme", true) == 0) { this.currentScheme = xmlTextReader.ReadString(); this.LoadScheme(this.currentScheme); } else if (string.Compare(xmlTextReader.Name, "ip_address", true) == 0) { this.serverIPFromConfig = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "server_name", true) == 0) { this.serverNameFromConfig = xmlTextReader.ReadString(); } else if (string.Compare(xmlTextReader.Name, "application_path", true) == 0) { this.serverPath = xmlTextReader.ReadString(); } } } xmlTextReader.Close(); } } } catch (Exception ex) { this.Cursor = Cursors.Default; this.ShowMessage("Problem opening configuration file", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } } // Token: 0x060000BD RID: 189 RVA: 0x0000D578 File Offset: 0x0000B778 private void SaveConfToXML() { if (this.IsOriginalInstallationPC()) { try { this.Cursor = Cursors.WaitCursor; string filename = AppDomain.CurrentDomain.BaseDirectory + "Configuration.xml"; using (XmlTextWriter xmlTextWriter = new XmlTextWriter(filename, null)) { xmlTextWriter.Formatting = Formatting.Indented; xmlTextWriter.WriteStartDocument(); xmlTextWriter.WriteStartElement("Configuration"); xmlTextWriter.WriteStartElement("connection_info"); xmlTextWriter.WriteElementString("ip", this.serverName); xmlTextWriter.WriteElementString("user_name", this.userName); xmlTextWriter.WriteElementString("database_name", this.databaseName); xmlTextWriter.WriteElementString("port_name", this.portName); xmlTextWriter.WriteElementString("password", this.passWord); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteStartElement("server_info"); xmlTextWriter.WriteElementString("ip_address", this.GetCurrentIP()); xmlTextWriter.WriteElementString("server_name", this.GetComputerName()); xmlTextWriter.WriteElementString("application_path", AppDomain.CurrentDomain.BaseDirectory); if (this.databaseType == frm.dbType.local) { xmlTextWriter.WriteElementString("dbType", "local"); } else { xmlTextWriter.WriteElementString("dbType", "online"); } xmlTextWriter.WriteElementString("is_portable", this.chkIsPortableDatabase.Checked.ToString()); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteStartElement("general_info"); xmlTextWriter.WriteElementString("lastCompanyID", this.currentCompanyID.ToString()); xmlTextWriter.WriteElementString("lastCompanyName", this.currentCompanyName); xmlTextWriter.WriteElementString("lastBackupFolder", this.lastBackupFolder); xmlTextWriter.WriteElementString("scheme", this.SchemeColor.ToString()); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteEndDocument(); xmlTextWriter.Flush(); xmlTextWriter.Close(); } this.Cursor = Cursors.Default; } catch (Exception ex) { this.Cursor = Cursors.Default; this.ShowMessage("Problem saving configuration file", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } } } // Token: 0x060000BE RID: 190 RVA: 0x0000D800 File Offset: 0x0000BA00 private void LoadConfiguration(int CompanyID) { this.cmmMySql.CommandText = string.Format("SELECT * FROM programs_config WHERE CompanyID = {0}", CompanyID.ToString()); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { this.drMySql.Read(); string @string = this.drMySql.GetString("SellingOverQtyOption"); if (string.Compare(@string, "ignore", true) == 0) { this.btnConfSales_SellingOverQty.Text = "Do nothing"; } else if (string.Compare(@string, "warn", true) == 0) { this.btnConfSales_SellingOverQty.Text = "Warn the user"; } else if (string.Compare(@string, "prevent", true) == 0) { this.btnConfSales_SellingOverQty.Text = "Prevent the user"; } string string2 = this.drMySql.GetString("SellingUnderCostOption"); if (string.Compare(string2, "ignore", true) == 0) { this.btnConfSales_UnderCost.Text = "Do nothing"; } else if (string.Compare(string2, "warn", true) == 0) { this.btnConfSales_UnderCost.Text = "Warn the user"; } else if (string.Compare(string2, "prevent", true) == 0) { this.btnConfSales_UnderCost.Text = "Prevent the user"; } if (this.drMySql.GetInt16("InvShowRetailPriceExcl") == 1) { this.btnConfSales_ShowVAT.Text = "Excluding VAT"; } else { this.btnConfSales_ShowVAT.Text = "Including VAT"; } if (string.Compare(this.drMySql.GetString("DefaultInvoiceType"), "CashInvoice", true) == 0 | string.IsNullOrEmpty(this.drMySql.GetString("DefaultInvoiceType"))) { this.btnConfSales_DefaultTrans.Text = "Cash Invoice"; } else if (string.Compare(this.drMySql.GetString("DefaultInvoiceType"), "AccInvoice", true) == 0) { this.btnConfSales_DefaultTrans.Text = "Account Invoice"; } else { this.btnConfSales_DefaultTrans.Text = "Let me choose"; } Enum.TryParse(this.drMySql.GetString("AfterAddingItemToGridDo"), true, out this.afterAddingItemToGrid); string empty = string.Empty; if (this.dictAfterAddingItemToGrid.TryGetValue(this.afterAddingItemToGrid, out empty)) { this.btnConfAfterAddingNewItemToGridDo.Text = empty; } this.txtConfPaymentMethods.Text = this.drMySql.GetString("PaymentMethods"); this.txtConfSlipNote_Invoices.Text = this.drMySql.GetString("InvSlipNote"); this.txtConfSlipNote_Quotations.Text = this.drMySql.GetString("QuotationSlipNote"); this.txtPriceOverridePassword.Text = this.drMySql.GetString("PriceOverridePassword"); this.btnPriceEmbeddedPrefix.Text = this.drMySql.GetString("PriceEmbeddedPrefix"); if (this.drMySql.GetInt16("ShowAmountDueOnSalesDocs") == 1) { this.chkShowAmountDueOnSalesDocs.Checked = true; } else { this.chkShowAmountDueOnSalesDocs.Checked = false; } this.btnConfPrintTo_CashInvoice.Text = this.drMySql.GetString("PrintTo_CashInvoice"); this.btnConfPrintTo_Refund.Text = this.drMySql.GetString("PrintTo_Refund"); this.btnConfPrintTo_Payout.Text = this.drMySql.GetString("PrintTo_Payout"); this.btnConfPrintTo_AccInvoice.Text = this.drMySql.GetString("PrintTo_AccInvoice"); this.btnConfPrintTo_CreditNote.Text = this.drMySql.GetString("PrintTo_CreditNote"); this.btnConfPrintTo_Receipt.Text = this.drMySql.GetString("PrintTo_Receipt"); this.btnConfPrintTo_Journal.Text = this.drMySql.GetString("PrintTo_Journal"); this.btnConfPrintTo_Quotation.Text = this.drMySql.GetString("PrintTo_Quotation"); this.btnConfPrintTo_ProformaInvoice.Text = this.drMySql.GetString("PrintTo_ProformaInvoice"); this.btnConfPrintTo_IBT.Text = this.drMySql.GetString("PrintTo_IBT"); this.btnConfPrintTo_IBTreturn.Text = this.drMySql.GetString("PrintTo_IBTreturn"); this.txtConfCopies_CashInvoice.Text = this.drMySql.GetString("Copies_CashInvoice"); this.txtConfCopies_Refund.Text = this.drMySql.GetString("Copies_Refund"); this.txtConfCopies_Payout.Text = this.drMySql.GetString("Copies_Payout"); this.txtConfCopies_AccInvoice.Text = this.drMySql.GetString("Copies_AccInvoice"); this.txtConfCopies_CreditNote.Text = this.drMySql.GetString("Copies_CreditNote"); this.txtConfCopies_Receipt.Text = this.drMySql.GetString("Copies_Receipt"); this.txtConfCopies_Journal.Text = this.drMySql.GetString("Copies_Journal"); this.txtConfCopies_Quotation.Text = this.drMySql.GetString("Copies_Quotation"); this.txtConfCopies_ProformaInvoice.Text = this.drMySql.GetString("Copies_ProformaInvoice"); this.txtConfCopies_IBT.Text = this.drMySql.GetString("Copies_IBT"); this.txtConfCopies_IBTreturn.Text = this.drMySql.GetString("Copies_IBTreturn"); this.btnConfSize_CashInvoice.Text = this.drMySql.GetString("SlipSize_CashInvoice"); this.btnConfSize_Refund.Text = this.drMySql.GetString("SlipSize_Refund"); this.btnConfSize_Payout.Text = this.drMySql.GetString("SlipSize_Payout"); this.btnConfSize_AccInvoice.Text = this.drMySql.GetString("SlipSize_AccInvoice"); this.btnConfSize_CreditNote.Text = this.drMySql.GetString("SlipSize_CreditNote"); this.btnConfSize_Receipt.Text = this.drMySql.GetString("SlipSize_Receipt"); this.btnConfSize_Journal.Text = this.drMySql.GetString("SlipSize_Journal"); this.btnConfSize_Quotation.Text = this.drMySql.GetString("SlipSize_Quotation"); this.btnConfSize_ProformaInvoice.Text = this.drMySql.GetString("SlipSize_ProformaInvoice"); this.btnConfSize_IBT.Text = this.drMySql.GetString("SlipSize_IBT"); this.btnConfSize_IBTreturn.Text = this.drMySql.GetString("SlipSize_IBTreturn"); this.btnConfAfterTransDo1_CashInvoice.Text = this.drMySql.GetString("AfterTransDo1_CashInvoice"); this.btnConfAfterTransDo1_Refund.Text = this.drMySql.GetString("AfterTransDo1_Refund"); this.btnConfAfterTransDo1_Payout.Text = this.drMySql.GetString("AfterTransDo1_Payout"); this.btnConfAfterTransDo1_AccInvoice.Text = this.drMySql.GetString("AfterTransDo1_AccInvoice"); this.btnConfAfterTransDo1_CreditNote.Text = this.drMySql.GetString("AfterTransDo1_CreditNote"); this.btnConfAfterTransDo1_Receipt.Text = this.drMySql.GetString("AfterTransDo1_Receipt"); this.btnConfAfterTransDo1_Journal.Text = this.drMySql.GetString("AfterTransDo1_Journal"); this.btnConfAfterTransDo1_Quotation.Text = this.drMySql.GetString("AfterTransDo1_Quotation"); this.btnConfAfterTransDo1_ProformaInvoice.Text = this.drMySql.GetString("AfterTransDo1_ProformaInvoice"); this.btnConfAfterTransDo1_IBT.Text = this.drMySql.GetString("AfterTransDo1_IBT"); this.btnConfAfterTransDo1_IBTreturn.Text = this.drMySql.GetString("AfterTransDo1_IBTreturn"); this.btnConfAfterTransDo2_CashInvoice.Text = this.drMySql.GetString("AfterTransDo2_AccInvoice"); this.btnConfAfterTransDo2_Refund.Text = this.drMySql.GetString("AfterTransDo2_Refund"); this.btnConfAfterTransDo2_Payout.Text = this.drMySql.GetString("AfterTransDo2_Payout"); this.btnConfAfterTransDo2_AccInvoice.Text = this.drMySql.GetString("AfterTransDo2_AccInvoice"); this.btnConfAfterTransDo2_CreditNote.Text = this.drMySql.GetString("AfterTransDo2_CreditNote"); this.btnConfAfterTransDo2_Receipt.Text = this.drMySql.GetString("AfterTransDo2_Receipt"); this.btnConfAfterTransDo2_Journal.Text = this.drMySql.GetString("AfterTransDo2_Journal"); this.btnConfAfterTransDo2_Quotation.Text = this.drMySql.GetString("AfterTransDo2_Quotation"); this.btnConfAfterTransDo2_ProformaInvoice.Text = this.drMySql.GetString("AfterTransDo2_ProformaInvoice"); this.btnConfAfterTransDo2_IBT.Text = this.drMySql.GetString("AfterTransDo2_IBT"); this.btnConfAfterTransDo2_IBTreturn.Text = this.drMySql.GetString("AfterTransDo2_IBTreturn"); this.txtConfCustomLabel1.Text = this.drMySql.GetString("InvCustomLabel1"); this.txtConfCustomLabel2.Text = this.drMySql.GetString("InvCustomLabel2"); this.txtConfCustomLabel3.Text = this.drMySql.GetString("InvCustomLabel3"); this.txtConfCustomLabel4.Text = this.drMySql.GetString("InvCustomLabel4"); this.txtConfCustomLabel5.Text = this.drMySql.GetString("InvCustomLabel5"); this.txtConfCustomLabel6.Text = this.drMySql.GetString("InvCustomLabel6"); this.txtConfCustomValue1.Text = this.drMySql.GetString("InvCustomValue1"); this.txtConfCustomValue2.Text = this.drMySql.GetString("InvCustomValue2"); this.txtConfCustomValue3.Text = this.drMySql.GetString("InvCustomValue3"); this.txtConfCustomValue4.Text = this.drMySql.GetString("InvCustomValue4"); this.txtConfCustomValue5.Text = this.drMySql.GetString("InvCustomValue5"); this.txtConfCustomValue6.Text = this.drMySql.GetString("InvCustomValue6"); this.btnConfEmailAccounts.Text = this.drMySql.GetString("EmailAccount"); this.txtConfEmailAddress.Text = this.drMySql.GetString("EmailAddress"); this.txtConfEmailUserName.Text = this.drMySql.GetString("EmailUserName"); this.txtConfEmailPassword.Text = this.drMySql.GetString("EmailPassword"); this.txtConfEmailSMTPAddress.Text = this.drMySql.GetString("EmailSMTPAddress"); this.txtConfEmailSMTPPort.Text = this.drMySql.GetString("EmailSMTPPort"); this.txtConfPayOutReasons.Text = this.drMySql.GetString("PayOutReasons"); if (this.IsOriginalInstallationPC()) { string string3 = this.drMySql.GetString("CashDrawerType"); Console.WriteLine("Cash drawer type:" + string3); if (string.Compare(string3, "none", true) == 0) { this.btnConfDrawer_Type.Text = "None"; } else if (string.Compare(string3, "usb", true) == 0) { this.btnConfDrawer_Type.Text = "USB to Com/Com"; } else if (string.Compare(string3, "rj11", true) == 0) { this.btnConfDrawer_Type.Text = "RJ11 (back of slip printer)"; } this.txtConfComPort.Text = this.drMySql.GetString("CashDrawerComPort"); this.txtConfDrawerCode1.Text = this.drMySql.GetString("CashDrawerKickerCode1"); this.txtConfDrawerCode2.Text = this.drMySql.GetString("CashDrawerKickerCode2"); this.txtConfDrawerCode3.Text = this.drMySql.GetString("CashDrawerKickerCode3"); this.txtConfDrawerCode4.Text = this.drMySql.GetString("CashDrawerKickerCode4"); this.txtConfDrawerCode5.Text = this.drMySql.GetString("CashDrawerKickerCode5"); this.txtConfDrawerCode6.Text = this.drMySql.GetString("CashDrawerKickerCode6"); this.txtConfDrawerCode7.Text = this.drMySql.GetString("CashDrawerKickerCode7"); this.txtConfDrawerCode8.Text = this.drMySql.GetString("CashDrawerKickerCode8"); this.btnConfDrawerSlipPrinter.Text = this.drMySql.GetString("CashDrawerSlipPrinter"); } this.btnConfQtyDecimals.Text = this.drMySql.GetString("QtyDecimalValue"); this.btnRoundToValue.Text = this.drMySql.GetString("RoundToValue"); string string4 = this.drMySql.GetString("IsPortableDatabase"); if (string4 == "1") { this.chkIsPortableDatabase.Checked = true; } else { this.chkIsPortableDatabase.Checked = false; } string4 = this.drMySql.GetString("AllowSalesDiscount"); if (string4 == "1") { this.chkAllowSalesDiscount.Checked = true; this.chkShowDiscountOnSalesDocument.Visible = true; } else { this.chkAllowSalesDiscount.Checked = false; this.chkShowDiscountOnSalesDocument.Visible = false; } string4 = this.drMySql.GetString("ShowDiscountOnSalesDocument"); if (string4 == "1") { this.chkShowDiscountOnSalesDocument.Checked = true; } else { this.chkShowDiscountOnSalesDocument.Checked = false; } this.txtQuotationDefaultName.Text = this.drMySql.GetString("QuotationDefaultName"); this.txtProformaDefaultName.Text = this.drMySql.GetString("ProformaDefaultName"); string4 = this.drMySql.GetString("ShowSalesSidePanelPicture"); if (string4 == "1") { this.chkShowSalesSidePanelPicture.Checked = true; } else { this.chkShowSalesSidePanelPicture.Checked = false; } string4 = this.drMySql.GetString("ShowSalesSidePanelNote"); if (string4 == "1") { this.chkShowSalesSidePanelNote.Checked = true; } else { this.chkShowSalesSidePanelNote.Checked = false; } string4 = this.drMySql.GetString("ShowSalesSidePanelItemDetails"); if (string4 == "1") { this.chkShowSalesSidePanelItemDetails.Checked = true; } else { this.chkShowSalesSidePanelItemDetails.Checked = false; } string4 = this.drMySql.GetString("ShowSalesSidePanelAltItems"); if (string4 == "1") { this.chkShowSalesSidePanelAltItems.Checked = true; } else { this.chkShowSalesSidePanelAltItems.Checked = false; } if (this.purchasesModuleExist) { if (string.Compare(this.drMySql.GetString("DefaultPurchaseType"), "CashPurchase", true) == 0 | string.IsNullOrEmpty(this.drMySql.GetString("DefaultPurchaseType"))) { this.btnConfPurchase_DefaultTrans.Text = "Cash Purchase"; } else if (string.Compare(this.drMySql.GetString("DefaultPurchaseType"), "AccPurchase", true) == 0) { this.btnConfPurchase_DefaultTrans.Text = "Account Invoice"; } else { this.btnConfPurchase_DefaultTrans.Text = "Let me choose"; } frm.AfterAddingItemToGrid key = frm.AfterAddingItemToGrid.NewLine; Enum.TryParse(this.drMySql.GetString("AfterAddingItemToGridDo_Purchases"), true, out key); string empty2 = string.Empty; if (this.dictAfterAddingItemToGrid.TryGetValue(key, out empty2)) { this.btnConfAfterAddingNewItemToGridDo_Purchases.Text = empty2; } this.btnConfPrintTo_CashPurchase.Text = this.drMySql.GetString("PrintTo_CashPurchase"); this.btnConfPrintTo_CashPurchaseReturn.Text = this.drMySql.GetString("PrintTo_CashPurchaseReturn"); this.btnConfPrintTo_AccPurchase.Text = this.drMySql.GetString("PrintTo_AccPurchase"); this.btnConfPrintTo_DebitNote.Text = this.drMySql.GetString("PrintTo_DebitNote"); this.btnConfPrintTo_Payment.Text = this.drMySql.GetString("PrintTo_Payment"); this.btnConfPrintTo_CreditorJournal.Text = this.drMySql.GetString("PrintTo_CreditorJournal"); this.btnConfPrintTo_PurchaseOrder.Text = this.drMySql.GetString("PrintTo_PurchaseOrder"); this.txtConfCopies_CashPurchase.Text = this.drMySql.GetString("Copies_CashPurchase"); this.txtConfCopies_CashPurchaseReturn.Text = this.drMySql.GetString("Copies_CashPurchaseReturn"); this.txtConfCopies_AccPurchase.Text = this.drMySql.GetString("Copies_AccPurchase"); this.txtConfCopies_DebitNote.Text = this.drMySql.GetString("Copies_DebitNote"); this.txtConfCopies_Payment.Text = this.drMySql.GetString("Copies_Payment"); this.txtConfCopies_CreditorJournal.Text = this.drMySql.GetString("Copies_CreditorJournal"); this.txtConfCopies_PurchaseOrder.Text = this.drMySql.GetString("Copies_PurchaseOrder"); this.btnConfSize_CashPurchase.Text = this.drMySql.GetString("SlipSize_CashPurchase"); this.btnConfSize_CashPurchaseReturn.Text = this.drMySql.GetString("SlipSize_CashPurchaseReturn"); this.btnConfSize_AccPurchase.Text = this.drMySql.GetString("SlipSize_AccPurchase"); this.btnConfSize_DebitNote.Text = this.drMySql.GetString("SlipSize_DebitNote"); this.btnConfSize_Payment.Text = this.drMySql.GetString("SlipSize_Payment"); this.btnConfSize_CreditorJournal.Text = this.drMySql.GetString("SlipSize_CreditorJournal"); this.btnConfSize_PurchaseOrder.Text = this.drMySql.GetString("SlipSize_PurchaseOrder"); this.btnConfAfterTransDo1_CashPurchase.Text = this.drMySql.GetString("AfterTransDo1_CashPurchase"); this.btnConfAfterTransDo1_CashPurchaseReturn.Text = this.drMySql.GetString("AfterTransDo1_CashPurchaseReturn"); this.btnConfAfterTransDo1_AccPurchase.Text = this.drMySql.GetString("AfterTransDo1_AccPurchase"); this.btnConfAfterTransDo1_DebitNote.Text = this.drMySql.GetString("AfterTransDo1_DebitNote"); this.btnConfAfterTransDo1_Payment.Text = this.drMySql.GetString("AfterTransDo1_Payment"); this.btnConfAfterTransDo1_CreditorJournal.Text = this.drMySql.GetString("AfterTransDo1_CreditorJournal"); this.btnConfAfterTransDo1_PurchaseOrder.Text = this.drMySql.GetString("AfterTransDo1_PurchaseOrder"); this.btnConfAfterTransDo2_CashPurchase.Text = this.drMySql.GetString("AfterTransDo2_CashPurchase"); this.btnConfAfterTransDo2_CashPurchaseReturn.Text = this.drMySql.GetString("AfterTransDo2_CashPurchaseReturn"); this.btnConfAfterTransDo2_AccPurchase.Text = this.drMySql.GetString("AfterTransDo2_AccPurchase"); this.btnConfAfterTransDo2_DebitNote.Text = this.drMySql.GetString("AfterTransDo2_DebitNote"); this.btnConfAfterTransDo2_Payment.Text = this.drMySql.GetString("AfterTransDo2_Payment"); this.btnConfAfterTransDo2_CreditorJournal.Text = this.drMySql.GetString("AfterTransDo2_CreditorJournal"); this.btnConfAfterTransDo2_PurchaseOrder.Text = this.drMySql.GetString("AfterTransDo2_PurchaseOrder"); this.txtConfCustomLabel1_Purchases.Text = this.drMySql.GetString("PurchaseCustomLabel1"); this.txtConfCustomLabel2_Purchases.Text = this.drMySql.GetString("PurchaseCustomLabel2"); this.txtConfCustomLabel3_Purchases.Text = this.drMySql.GetString("PurchaseCustomLabel3"); this.txtConfCustomLabel4_Purchases.Text = this.drMySql.GetString("PurchaseCustomLabel4"); this.txtConfCustomLabel5_Purchases.Text = this.drMySql.GetString("PurchaseCustomLabel5"); this.txtConfCustomLabel6_Purchases.Text = this.drMySql.GetString("PurchaseCustomLabel6"); this.txtConfCustomValue1_Purchases.Text = this.drMySql.GetString("PurchaseCustomValue1"); this.txtConfCustomValue2_Purchases.Text = this.drMySql.GetString("PurchaseCustomValue2"); this.txtConfCustomValue3_Purchases.Text = this.drMySql.GetString("PurchaseCustomValue3"); this.txtConfCustomValue4_Purchases.Text = this.drMySql.GetString("PurchaseCustomValue4"); this.txtConfCustomValue5_Purchases.Text = this.drMySql.GetString("PurchaseCustomValue5"); this.txtConfCustomValue6_Purchases.Text = this.drMySql.GetString("PurchaseCustomValue6"); string4 = this.drMySql.GetString("AllowPurchaseDiscount"); if (string4 == "1") { this.chkAllowPurchaseDiscount.Checked = true; this.chkShowDiscountOnPurchaseDocument.Visible = true; } else { this.chkAllowPurchaseDiscount.Checked = false; this.chkShowDiscountOnPurchaseDocument.Visible = false; } string4 = this.drMySql.GetString("ShowDiscountOnPurchaseDocument"); if (string4 == "1") { this.chkShowDiscountOnPurchaseDocument.Checked = true; } else { this.chkShowDiscountOnPurchaseDocument.Checked = false; } if (this.itemsModuleExist) { if (string.Compare(this.drMySql.GetString("DefaultItemType"), "ItemDetails", true) == 0 | string.IsNullOrEmpty(this.drMySql.GetString("DefaultItemType"))) { this.btnConfItems_DefaultTrans.Text = "Item Details"; } else if (string.Compare(this.drMySql.GetString("DefaultItemType"), "StockTake", true) == 0) { this.btnConfItems_DefaultTrans.Text = "Stock Take"; } else { this.btnConfItems_DefaultTrans.Text = "Let me choose"; } string4 = this.drMySql.GetString("StockTakeMethod"); if (string.Compare(string4, "WallToWall", true) == 0) { this.btnConfStockTake_DefaultTrans.Text = "Wall to Wall"; } else if (string.Compare(string4, "Location", true) == 0) { this.btnConfStockTake_DefaultTrans.Text = "Location"; } else if (string.Compare(string4, "SubLocation", true) == 0) { this.btnConfStockTake_DefaultTrans.Text = "Sub-Location"; } else if (string.Compare(string4, "Category", true) == 0) { this.btnConfStockTake_DefaultTrans.Text = "Category"; } else if (string.Compare(string4, "SubCategory", true) == 0) { this.btnConfStockTake_DefaultTrans.Text = "Sub-Category"; } string4 = this.drMySql.GetString("StockTake_ShowQtyAvailable"); if (string4 == "1") { this.chkStockTake_ShowQtyAvailable.Checked = true; } else { this.chkStockTake_ShowQtyAvailable.Checked = false; } string4 = this.drMySql.GetString("StockTake_LoadRecords"); if (string4 == "1") { this.chkStockTake_LoadRecords.Checked = true; } else { this.chkStockTake_LoadRecords.Checked = false; } this.btnStockTake_AfterSavingSheet.Text = this.drMySql.GetString("StockTake_AfterSavingSheet"); this.btnStockTake_PrintSheetTo.Text = this.drMySql.GetString("StockTake_AfterSavingSheet_PrintTo"); if (string.Compare(this.btnStockTake_AfterSavingSheet.Text, "print variance report", true) == 0) { this.btnStockTake_PrintSheetTo.Visible = true; } else { this.btnStockTake_PrintSheetTo.Visible = false; } this.btnStockTake_VarianceOrderBy.Text = this.drMySql.GetString("StockTake_VarianceOrderBy"); this.btnStockTake_VarianceShow.Text = this.drMySql.GetString("StockTake_VarianceShow"); this.btnLinkedItemsOptions.Text = this.drMySql.GetString("LinkedItemsOptions"); } } } this.drMySql.Close(); if (this.itemsModuleExist) { this.cmmMySql.CommandText = string.Format("SELECT * FROM label_generator_config WHERE CompanyID = {0}", CompanyID); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { this.drMySql.Read(); this.btnConfLabel_PrintTo.Text = this.drMySql.GetString("PrintTo"); this.btnUseThisLabel.Text = this.drMySql.GetString("UseThisLabel"); this.btnConfLabel_RetailPrice.Text = this.drMySql.GetString("ShowRetailPrice"); this.btnConfLabel_Custom1.Text = this.drMySql.GetString("Custom1"); this.btnConfLabel_Custom2.Text = this.drMySql.GetString("Custom2"); this.btnConfLabel_Custom3.Text = this.drMySql.GetString("Custom3"); } this.drMySql.Close(); } if (!this.IsOriginalInstallationPC()) { this.LoadWorkstationConfig(CompanyID); } this.SetDrawerConfigType(); this.FillAvailableProgramsListBox(); if (this.LoadUsers(CompanyID) == 0) { this.LoadUsers(1); } this.lvConfUsers.Items[0].Selected = true; this.LoadSelectedUserDetails(); } // Token: 0x060000BF RID: 191 RVA: 0x0000F3D0 File Offset: 0x0000D5D0 private void SaveConfiguration(bool newConfig, int CompanyID) { try { StringBuilder stringBuilder = new StringBuilder(); string arg = string.Empty; stringBuilder.AppendFormat("CompanyID = '{0}', ", CompanyID); if (string.Compare(this.btnConfSales_UnderCost.Text, "Do nothing", true) == 0) { arg = "ignore"; } else if (string.Compare(this.btnConfSales_UnderCost.Text, "Warn the user", true) == 0) { arg = "warn"; } else if (string.Compare(this.btnConfSales_UnderCost.Text, "Prevent the user", true) == 0) { arg = "prevent"; } stringBuilder.AppendFormat("SellingUnderCostOption = '{0}', ", arg); if (string.Compare(this.btnConfSales_SellingOverQty.Text, "Do nothing", true) == 0) { arg = "ignore"; } else if (string.Compare(this.btnConfSales_SellingOverQty.Text, "Warn the user", true) == 0) { arg = "warn"; } else if (string.Compare(this.btnConfSales_SellingOverQty.Text, "Prevent the user", true) == 0) { arg = "prevent"; } stringBuilder.AppendFormat("SellingOverQtyOption = '{0}', ", arg); if (string.Compare(this.btnConfSales_ShowVAT.Text, "Excluding VAT", true) == 0) { stringBuilder.Append("InvShowRetailPriceExcl = 1, "); } else { stringBuilder.Append("InvShowRetailPriceExcl = 0, "); } if (this.chkShowAmountDueOnSalesDocs.Checked) { stringBuilder.Append("ShowAmountDueOnSalesDocs = 1, "); } else { stringBuilder.Append("ShowAmountDueOnSalesDocs = 0, "); } if (string.Compare(this.btnConfSales_DefaultTrans.Text, "Cash Invoice", true) == 0) { stringBuilder.AppendFormat("DefaultInvoiceType = '{0}', ", "CashInvoice"); } else if (string.Compare(this.btnConfSales_DefaultTrans.Text, "Account Invoice", true) == 0) { stringBuilder.AppendFormat("DefaultInvoiceType = '{0}', ", "AccInvoice"); } else { stringBuilder.AppendFormat("DefaultInvoiceType = '{0}', ", "Choose"); } if (this.itemsModuleExist) { if (string.Compare(this.btnConfItems_DefaultTrans.Text, "Item Details", true) == 0) { stringBuilder.AppendFormat("DefaultItemType = '{0}', ", "ItemDetails"); } else if (string.Compare(this.btnConfItems_DefaultTrans.Text, "Stock Take", true) == 0) { stringBuilder.AppendFormat("DefaultItemType = '{0}', ", "StockTake"); } else { stringBuilder.AppendFormat("DefaultItemType = '{0}', ", "Choose"); } if (string.Compare(this.btnConfStockTake_DefaultTrans.Text, "Wall to Wall", true) == 0) { stringBuilder.Append("StockTakeMethod = 'WallToWall', "); } else if (string.Compare(this.btnConfStockTake_DefaultTrans.Text, "Location", true) == 0) { stringBuilder.Append("StockTakeMethod = 'Location', "); } else if (string.Compare(this.btnConfStockTake_DefaultTrans.Text, "Sub-Location", true) == 0) { stringBuilder.Append("StockTakeMethod = 'SubLocation', "); } else if (string.Compare(this.btnConfStockTake_DefaultTrans.Text, "Category", true) == 0) { stringBuilder.Append("StockTakeMethod = 'Category', "); } else if (string.Compare(this.btnConfStockTake_DefaultTrans.Text, "Sub-Category", true) == 0) { stringBuilder.Append("StockTakeMethod = 'SubCategory', "); } stringBuilder.Append(this.chkStockTake_ShowQtyAvailable.Checked ? "StockTake_ShowQtyAvailable = 1, " : "StockTake_ShowQtyAvailable = 0, "); stringBuilder.Append(this.chkStockTake_LoadRecords.Checked ? "StockTake_LoadRecords = 1, " : "StockTake_LoadRecords = 0, "); stringBuilder.AppendFormat("StockTake_AfterSavingSheet = '{0}', ", this.btnStockTake_AfterSavingSheet.Text); stringBuilder.AppendFormat("StockTake_AfterSavingSheet_PrintTo = '{0}', ", this.btnStockTake_PrintSheetTo.Text); stringBuilder.AppendFormat("StockTake_VarianceOrderBy = '{0}', ", this.btnStockTake_VarianceOrderBy.Text); stringBuilder.AppendFormat("StockTake_VarianceShow = '{0}', ", this.btnStockTake_VarianceShow.Text); stringBuilder.AppendFormat("LinkedItemsOptions = '{0}', ", this.btnLinkedItemsOptions.Text); } frm.AfterAddingItemToGrid afterAddingItemToGrid = (from p in this.dictAfterAddingItemToGrid where p.Value == this.btnConfAfterAddingNewItemToGridDo.Text select p.Key).First(); stringBuilder.AppendFormat("AfterAddingItemToGridDo = '{0}', ", afterAddingItemToGrid); stringBuilder.AppendFormat("PaymentMethods = '{0}', ", this.txtConfPaymentMethods.Text); stringBuilder.AppendFormat("InvSlipNote = '{0}', ", this.txtConfSlipNote_Invoices.Text); stringBuilder.AppendFormat("QuotationSlipNote = '{0}', ", this.txtConfSlipNote_Quotations.Text); stringBuilder.AppendFormat("PriceOverridePassword = '{0}', ", this.txtPriceOverridePassword.Text); stringBuilder.AppendFormat("PriceEmbeddedPrefix = '{0}', ", this.btnPriceEmbeddedPrefix.Text); stringBuilder.AppendFormat("QuotationDefaultName = '{0}', ", this.txtQuotationDefaultName.Text); stringBuilder.AppendFormat("ProformaDefaultName = '{0}', ", this.txtProformaDefaultName.Text); stringBuilder.AppendFormat("Copies_CashInvoice = '{0}', ", this.txtConfCopies_CashInvoice.Text); stringBuilder.AppendFormat("Copies_Refund = '{0}', ", this.txtConfCopies_Refund.Text); stringBuilder.AppendFormat("Copies_Payout = '{0}', ", this.txtConfCopies_Payout.Text); stringBuilder.AppendFormat("Copies_AccInvoice = '{0}', ", this.txtConfCopies_AccInvoice.Text); stringBuilder.AppendFormat("Copies_CreditNote = '{0}', ", this.txtConfCopies_CreditNote.Text); stringBuilder.AppendFormat("Copies_Receipt = '{0}', ", this.txtConfCopies_Receipt.Text); stringBuilder.AppendFormat("Copies_Journal = '{0}', ", this.txtConfCopies_Journal.Text); stringBuilder.AppendFormat("Copies_Quotation = '{0}', ", this.txtConfCopies_Quotation.Text); stringBuilder.AppendFormat("Copies_ProformaInvoice = '{0}', ", this.txtConfCopies_ProformaInvoice.Text); stringBuilder.AppendFormat("Copies_IBT = '{0}', ", this.txtConfCopies_IBT.Text); stringBuilder.AppendFormat("Copies_IBTreturn = '{0}', ", this.txtConfCopies_IBTreturn.Text); if (this.IsOriginalInstallationPC()) { stringBuilder.AppendFormat("PrintTo_CashInvoice = '{0}', ", this.btnConfPrintTo_CashInvoice.Text); stringBuilder.AppendFormat("PrintTo_Refund = '{0}', ", this.btnConfPrintTo_Refund.Text); stringBuilder.AppendFormat("PrintTo_Payout = '{0}', ", this.btnConfPrintTo_Payout.Text); stringBuilder.AppendFormat("PrintTo_AccInvoice = '{0}', ", this.btnConfPrintTo_AccInvoice.Text); stringBuilder.AppendFormat("PrintTo_CreditNote = '{0}', ", this.btnConfPrintTo_CreditNote.Text); stringBuilder.AppendFormat("PrintTo_Receipt = '{0}', ", this.btnConfPrintTo_Receipt.Text); stringBuilder.AppendFormat("PrintTo_Journal = '{0}', ", this.btnConfPrintTo_Journal.Text); stringBuilder.AppendFormat("PrintTo_Quotation = '{0}', ", this.btnConfPrintTo_Quotation.Text); stringBuilder.AppendFormat("PrintTo_ProformaInvoice = '{0}', ", this.btnConfPrintTo_ProformaInvoice.Text); stringBuilder.AppendFormat("PrintTo_IBT = '{0}', ", this.btnConfPrintTo_IBT.Text); stringBuilder.AppendFormat("PrintTo_IBTreturn = '{0}', ", this.btnConfPrintTo_IBTreturn.Text); } stringBuilder.AppendFormat("SlipSize_CashInvoice = '{0}', ", this.btnConfSize_CashInvoice.Text); stringBuilder.AppendFormat("SlipSize_Refund = '{0}', ", this.btnConfSize_Refund.Text); stringBuilder.AppendFormat("SlipSize_Payout = '{0}', ", this.btnConfSize_Payout.Text); stringBuilder.AppendFormat("SlipSize_AccInvoice = '{0}', ", this.btnConfSize_AccInvoice.Text); stringBuilder.AppendFormat("SlipSize_CreditNote = '{0}', ", this.btnConfSize_CreditNote.Text); stringBuilder.AppendFormat("SlipSize_Receipt = '{0}', ", this.btnConfSize_Receipt.Text); stringBuilder.AppendFormat("SlipSize_Journal = '{0}', ", this.btnConfSize_Journal.Text); stringBuilder.AppendFormat("SlipSize_Quotation = '{0}', ", this.btnConfSize_Quotation.Text); stringBuilder.AppendFormat("SlipSize_ProformaInvoice = '{0}', ", this.btnConfSize_ProformaInvoice.Text); stringBuilder.AppendFormat("SlipSize_IBT = '{0}', ", this.btnConfSize_IBT.Text); stringBuilder.AppendFormat("SlipSize_IBTreturn = '{0}', ", this.btnConfSize_IBTreturn.Text); stringBuilder.AppendFormat("AfterTransDo1_CashInvoice = '{0}', ", this.btnConfAfterTransDo1_CashInvoice.Text); stringBuilder.AppendFormat("AfterTransDo1_Refund = '{0}', ", this.btnConfAfterTransDo1_Refund.Text); stringBuilder.AppendFormat("AfterTransDo1_Payout = '{0}', ", this.btnConfAfterTransDo1_Payout.Text); stringBuilder.AppendFormat("AfterTransDo1_AccInvoice = '{0}', ", this.btnConfAfterTransDo1_AccInvoice.Text); stringBuilder.AppendFormat("AfterTransDo1_CreditNote = '{0}', ", this.btnConfAfterTransDo1_CreditNote.Text); stringBuilder.AppendFormat("AfterTransDo1_Receipt = '{0}', ", this.btnConfAfterTransDo1_Receipt.Text); stringBuilder.AppendFormat("AfterTransDo1_Journal = '{0}', ", this.btnConfAfterTransDo1_Journal.Text); stringBuilder.AppendFormat("AfterTransDo1_Quotation = '{0}', ", this.btnConfAfterTransDo1_Quotation.Text); stringBuilder.AppendFormat("AfterTransDo1_ProformaInvoice = '{0}', ", this.btnConfAfterTransDo1_ProformaInvoice.Text); stringBuilder.AppendFormat("AfterTransDo1_IBT = '{0}', ", this.btnConfAfterTransDo1_IBT.Text); stringBuilder.AppendFormat("AfterTransDo1_IBTreturn = '{0}', ", this.btnConfAfterTransDo1_IBTreturn.Text); stringBuilder.AppendFormat("AfterTransDo2_CashInvoice = '{0}', ", this.btnConfAfterTransDo2_CashInvoice.Text); stringBuilder.AppendFormat("AfterTransDo2_Refund = '{0}', ", this.btnConfAfterTransDo2_Refund.Text); stringBuilder.AppendFormat("AfterTransDo2_Payout = '{0}', ", this.btnConfAfterTransDo2_Payout.Text); stringBuilder.AppendFormat("AfterTransDo2_AccInvoice = '{0}', ", this.btnConfAfterTransDo2_AccInvoice.Text); stringBuilder.AppendFormat("AfterTransDo2_CreditNote = '{0}', ", this.btnConfAfterTransDo2_CreditNote.Text); stringBuilder.AppendFormat("AfterTransDo2_Receipt = '{0}', ", this.btnConfAfterTransDo2_Receipt.Text); stringBuilder.AppendFormat("AfterTransDo2_Journal = '{0}', ", this.btnConfAfterTransDo2_Journal.Text); stringBuilder.AppendFormat("AfterTransDo2_Quotation = '{0}', ", this.btnConfAfterTransDo2_Quotation.Text); stringBuilder.AppendFormat("AfterTransDo2_ProformaInvoice = '{0}', ", this.btnConfAfterTransDo2_ProformaInvoice.Text); stringBuilder.AppendFormat("AfterTransDo2_IBT = '{0}', ", this.btnConfAfterTransDo2_IBT.Text); stringBuilder.AppendFormat("AfterTransDo2_IBTreturn = '{0}', ", this.btnConfAfterTransDo2_IBTreturn.Text); stringBuilder.AppendFormat("InvCustomLabel1 = '{0}', ", this.txtConfCustomLabel1.Text); stringBuilder.AppendFormat("InvCustomLabel2 = '{0}', ", this.txtConfCustomLabel2.Text); stringBuilder.AppendFormat("InvCustomLabel3 = '{0}', ", this.txtConfCustomLabel3.Text); stringBuilder.AppendFormat("InvCustomLabel4 = '{0}', ", this.txtConfCustomLabel4.Text); stringBuilder.AppendFormat("InvCustomLabel5 = '{0}', ", this.txtConfCustomLabel5.Text); stringBuilder.AppendFormat("InvCustomLabel6 = '{0}', ", this.txtConfCustomLabel6.Text); stringBuilder.AppendFormat("InvCustomValue1 = '{0}', ", this.txtConfCustomValue1.Text); stringBuilder.AppendFormat("InvCustomValue2 = '{0}', ", this.txtConfCustomValue2.Text); stringBuilder.AppendFormat("InvCustomValue3 = '{0}', ", this.txtConfCustomValue3.Text); stringBuilder.AppendFormat("InvCustomValue4 = '{0}', ", this.txtConfCustomValue4.Text); stringBuilder.AppendFormat("InvCustomValue5 = '{0}', ", this.txtConfCustomValue5.Text); stringBuilder.AppendFormat("InvCustomValue6 = '{0}', ", this.txtConfCustomValue4.Text); stringBuilder.AppendFormat("EmailAccount = '{0}', ", this.btnConfEmailAccounts.Text); stringBuilder.AppendFormat("EmailAddress = '{0}', ", this.txtConfEmailAddress.Text); stringBuilder.AppendFormat("EmailUserName = '{0}', ", this.txtConfEmailUserName.Text); stringBuilder.AppendFormat("EmailPassword = '{0}', ", this.txtConfEmailPassword.Text); stringBuilder.AppendFormat("EmailSMTPAddress = '{0}', ", this.txtConfEmailSMTPAddress.Text); stringBuilder.AppendFormat("EmailSMTPPort = '{0}', ", this.txtConfEmailSMTPPort.Text); stringBuilder.AppendFormat("PayOutReasons = '{0}',", this.txtConfPayOutReasons.Text); if (this.IsOriginalInstallationPC()) { string arg2 = string.Empty; if (string.Compare(this.btnConfDrawer_Type.Text, "None", true) == 0) { arg2 = "none"; } else if (string.Compare(this.btnConfDrawer_Type.Text, "USB to Com/Com", true) == 0) { arg2 = "usb"; } else if (string.Compare(this.btnConfDrawer_Type.Text, "RJ11 (back of slip printer)", true) == 0) { arg2 = "rj11"; } stringBuilder.AppendFormat("CashDrawerType = '{0}', ", arg2); stringBuilder.AppendFormat("CashDrawerComPort = '{0}', ", this.txtConfComPort.Text); stringBuilder.AppendFormat("CashDrawerKickerCode1 = '{0}', ", this.txtConfDrawerCode1.Text); stringBuilder.AppendFormat("CashDrawerKickerCode2 = '{0}', ", this.txtConfDrawerCode2.Text); stringBuilder.AppendFormat("CashDrawerKickerCode3 = '{0}', ", this.txtConfDrawerCode3.Text); stringBuilder.AppendFormat("CashDrawerKickerCode4 = '{0}', ", this.txtConfDrawerCode4.Text); stringBuilder.AppendFormat("CashDrawerKickerCode5 = '{0}', ", this.txtConfDrawerCode5.Text); stringBuilder.AppendFormat("CashDrawerKickerCode6 = '{0}', ", this.txtConfDrawerCode6.Text); stringBuilder.AppendFormat("CashDrawerKickerCode7 = '{0}', ", this.txtConfDrawerCode7.Text); stringBuilder.AppendFormat("CashDrawerKickerCode8 = '{0}', ", this.txtConfDrawerCode8.Text); stringBuilder.AppendFormat("CashDrawerSlipPrinter = '{0}', ", this.btnConfDrawerSlipPrinter.Text); } stringBuilder.AppendFormat("QtyDecimalValue = '{0}', ", this.btnConfQtyDecimals.Text); stringBuilder.AppendFormat("RoundToValue = '{0}', ", this.btnRoundToValue.Text); if (this.chkIsPortableDatabase.Checked) { stringBuilder.Append("IsPortableDatabase = '1', "); } else { stringBuilder.Append("IsPortableDatabase = '0', "); } if (this.chkShowSalesSidePanelPicture.Checked) { stringBuilder.Append("ShowSalesSidePanelPicture = '1', "); } else { stringBuilder.Append("ShowSalesSidePanelPicture = '0', "); } if (this.chkShowSalesSidePanelNote.Checked) { stringBuilder.Append("ShowSalesSidePanelNote = '1', "); } else { stringBuilder.Append("ShowSalesSidePanelNote = '0', "); } if (this.chkShowSalesSidePanelItemDetails.Checked) { stringBuilder.Append("ShowSalesSidePanelItemDetails = '1', "); } else { stringBuilder.Append("ShowSalesSidePanelItemDetails = '0', "); } if (this.chkShowSalesSidePanelAltItems.Checked) { stringBuilder.Append("ShowSalesSidePanelAltItems = '1', "); } else { stringBuilder.Append("ShowSalesSidePanelAltItems = '0', "); } if (this.chkAllowSalesDiscount.Checked) { stringBuilder.Append("AllowSalesDiscount = '1', "); } else { stringBuilder.Append("AllowSalesDiscount = '0', "); } if (this.chkShowDiscountOnSalesDocument.Checked) { stringBuilder.Append("ShowDiscountOnSalesDocument = '1'"); } else { stringBuilder.Append("ShowDiscountOnSalesDocument = '0'"); } if (this.purchasesModuleExist) { if (string.Compare(this.btnConfPurchase_DefaultTrans.Text, "Cash Purchase", true) == 0) { stringBuilder.AppendFormat(", DefaultPurchaseType = '{0}', ", "CashPurchase"); } else if (string.Compare(this.btnConfPurchase_DefaultTrans.Text, "Account Purchase", true) == 0) { stringBuilder.AppendFormat(", DefaultPurchaseType = '{0}', ", "AccPurchase"); } else { stringBuilder.AppendFormat(", DefaultPurchaseType = '{0}', ", "Choose"); } if (this.chkAllowPurchaseDiscount.Checked) { stringBuilder.Append("AllowPurchaseDiscount = '1', "); } else { stringBuilder.Append("AllowPurchaseDiscount = '0', "); } if (this.chkShowDiscountOnPurchaseDocument.Checked) { stringBuilder.Append("ShowDiscountOnPurchaseDocument = '1', "); } else { stringBuilder.Append("ShowDiscountOnPurchaseDocument = '0', "); } frm.AfterAddingItemToGrid afterAddingItemToGrid2 = (from p in this.dictAfterAddingItemToGrid where p.Value == this.btnConfAfterAddingNewItemToGridDo_Purchases.Text select p.Key).First(); stringBuilder.AppendFormat("AfterAddingItemToGridDo_Purchases = '{0}', ", afterAddingItemToGrid2); stringBuilder.AppendFormat("Copies_CashPurchase = '{0}', ", this.txtConfCopies_CashPurchase.Text); stringBuilder.AppendFormat("Copies_CashPurchaseReturn = '{0}', ", this.txtConfCopies_CashPurchaseReturn.Text); stringBuilder.AppendFormat("Copies_AccPurchase = '{0}', ", this.txtConfCopies_AccPurchase.Text); stringBuilder.AppendFormat("Copies_DebitNote = '{0}', ", this.txtConfCopies_DebitNote.Text); stringBuilder.AppendFormat("Copies_Payment = '{0}', ", this.txtConfCopies_Payment.Text); stringBuilder.AppendFormat("Copies_CreditorJournal = '{0}', ", this.txtConfCopies_CreditorJournal.Text); stringBuilder.AppendFormat("Copies_PurchaseOrder = '{0}', ", this.txtConfCopies_PurchaseOrder.Text); if (this.IsOriginalInstallationPC()) { stringBuilder.AppendFormat("PrintTo_CashPurchase = '{0}', ", this.btnConfPrintTo_CashPurchase.Text); stringBuilder.AppendFormat("PrintTo_CashPurchaseReturn = '{0}', ", this.btnConfPrintTo_CashPurchaseReturn.Text); stringBuilder.AppendFormat("PrintTo_AccPurchase = '{0}', ", this.btnConfPrintTo_AccPurchase.Text); stringBuilder.AppendFormat("PrintTo_DebitNote = '{0}', ", this.btnConfPrintTo_DebitNote.Text); stringBuilder.AppendFormat("PrintTo_Payment = '{0}', ", this.btnConfPrintTo_Payment.Text); stringBuilder.AppendFormat("PrintTo_CreditorJournal = '{0}', ", this.btnConfPrintTo_CreditorJournal.Text); stringBuilder.AppendFormat("PrintTo_PurchaseOrder = '{0}', ", this.btnConfPrintTo_PurchaseOrder.Text); } stringBuilder.AppendFormat("SlipSize_CashPurchase = '{0}', ", this.btnConfSize_CashPurchase.Text); stringBuilder.AppendFormat("SlipSize_CashPurchaseReturn = '{0}', ", this.btnConfSize_CashPurchaseReturn.Text); stringBuilder.AppendFormat("SlipSize_AccPurchase = '{0}', ", this.btnConfSize_AccPurchase.Text); stringBuilder.AppendFormat("SlipSize_DebitNote = '{0}', ", this.btnConfSize_DebitNote.Text); stringBuilder.AppendFormat("SlipSize_Payment = '{0}', ", this.btnConfSize_Payment.Text); stringBuilder.AppendFormat("SlipSize_CreditorJournal = '{0}', ", this.btnConfSize_CreditorJournal.Text); stringBuilder.AppendFormat("SlipSize_PurchaseOrder = '{0}', ", this.btnConfSize_PurchaseOrder.Text); stringBuilder.AppendFormat("AfterTransDo1_CashPurchase = '{0}', ", this.btnConfAfterTransDo1_CashPurchase.Text); stringBuilder.AppendFormat("AfterTransDo1_CashPurchaseReturn = '{0}', ", this.btnConfAfterTransDo1_CashPurchaseReturn.Text); stringBuilder.AppendFormat("AfterTransDo1_AccPurchase = '{0}', ", this.btnConfAfterTransDo1_AccPurchase.Text); stringBuilder.AppendFormat("AfterTransDo1_DebitNote = '{0}', ", this.btnConfAfterTransDo1_DebitNote.Text); stringBuilder.AppendFormat("AfterTransDo1_Payment = '{0}', ", this.btnConfAfterTransDo1_Payment.Text); stringBuilder.AppendFormat("AfterTransDo1_CreditorJournal = '{0}', ", this.btnConfAfterTransDo1_CreditorJournal.Text); stringBuilder.AppendFormat("AfterTransDo1_PurchaseOrder = '{0}', ", this.btnConfAfterTransDo1_PurchaseOrder.Text); stringBuilder.AppendFormat("AfterTransDo2_CashPurchase = '{0}', ", this.btnConfAfterTransDo2_CashPurchase.Text); stringBuilder.AppendFormat("AfterTransDo2_CashPurchaseReturn = '{0}', ", this.btnConfAfterTransDo2_CashPurchaseReturn.Text); stringBuilder.AppendFormat("AfterTransDo2_AccPurchase = '{0}', ", this.btnConfAfterTransDo2_AccPurchase.Text); stringBuilder.AppendFormat("AfterTransDo2_DebitNote = '{0}', ", this.btnConfAfterTransDo2_DebitNote.Text); stringBuilder.AppendFormat("AfterTransDo2_Payment = '{0}', ", this.btnConfAfterTransDo2_Payment.Text); stringBuilder.AppendFormat("AfterTransDo2_CreditorJournal = '{0}', ", this.btnConfAfterTransDo2_CreditorJournal.Text); stringBuilder.AppendFormat("AfterTransDo2_PurchaseOrder = '{0}', ", this.btnConfAfterTransDo2_PurchaseOrder.Text); stringBuilder.AppendFormat("PurchaseCustomLabel1 = '{0}', ", this.txtConfCustomLabel1_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomLabel2 = '{0}', ", this.txtConfCustomLabel2_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomLabel3 = '{0}', ", this.txtConfCustomLabel3_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomLabel4 = '{0}', ", this.txtConfCustomLabel4_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomLabel5 = '{0}', ", this.txtConfCustomLabel5_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomLabel6 = '{0}', ", this.txtConfCustomLabel6_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomValue1 = '{0}', ", this.txtConfCustomValue1_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomValue2 = '{0}', ", this.txtConfCustomValue2_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomValue3 = '{0}', ", this.txtConfCustomValue3_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomValue4 = '{0}', ", this.txtConfCustomValue4_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomValue5 = '{0}', ", this.txtConfCustomValue5_Purchases.Text); stringBuilder.AppendFormat("PurchaseCustomValue6 = '{0}'", this.txtConfCustomValue6_Purchases.Text); } if (!newConfig) { this.cmmMySql.CommandText = string.Format("UPDATE programs_config SET {0} WHERE CompanyID = {1}", stringBuilder.ToString(), CompanyID.ToString()); } else { this.cmmMySql.CommandText = string.Format("INSERT INTO programs_config SET {0}", stringBuilder.ToString()); } this.cmmMySql.ExecuteNonQuery(); if (this.itemsModuleExist) { StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.AppendFormat("CompanyID = '{0}', ", CompanyID); stringBuilder2.AppendFormat("PrintTo = '{0}', ", this.btnConfLabel_PrintTo.Text); stringBuilder2.AppendFormat("UseThisLabel = '{0}', ", this.btnUseThisLabel.Text); stringBuilder2.AppendFormat("ShowRetailPrice = '{0}', ", this.btnConfLabel_RetailPrice.Text); stringBuilder2.AppendFormat("Custom1 = '{0}', ", this.btnConfLabel_Custom1.Text); stringBuilder2.AppendFormat("Custom2 = '{0}', ", this.btnConfLabel_Custom2.Text); stringBuilder2.AppendFormat("Custom3 = '{0}'", this.btnConfLabel_Custom3.Text); this.cmmMySql.CommandText = string.Format("SELECT count(id) FROM label_generator_config WHERE CompanyID = {0}", CompanyID.ToString()); int num = Convert.ToInt32(this.cmmMySql.ExecuteScalar()); if (num == 0) { this.cmmMySql.CommandText = string.Format("INSERT INTO label_generator_config SET {0}", stringBuilder2.ToString()); } else { this.cmmMySql.CommandText = string.Format("UPDATE label_generator_config SET {0} WHERE CompanyID = {1}", stringBuilder2.ToString(), CompanyID.ToString()); } this.cmmMySql.ExecuteNonQuery(); } if (!this.IsOriginalInstallationPC()) { this.SaveWorkstationConfig(CompanyID); } this.SaveAllUsers(CompanyID); } catch (Exception ex) { this.Cursor = Cursors.Default; this.ShowMessage("Problem saving configuration", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } } // Token: 0x060000C0 RID: 192 RVA: 0x00010AEC File Offset: 0x0000ECEC private void SaveWorkstationConfig(int CompanyID) { try { StringBuilder stringBuilder = new StringBuilder(); string arg = "none"; if (string.Compare(this.btnConfDrawer_Type.Text, "None", true) == 0) { arg = "none"; } else if (string.Compare(this.btnConfDrawer_Type.Text, "USB to Com/Com", true) == 0) { arg = "usb"; } else if (string.Compare(this.btnConfDrawer_Type.Text, "RJ11 (back of slip printer)", true) == 0) { arg = "rj11"; } stringBuilder.AppendFormat("CompanyID = {0}, ", CompanyID); stringBuilder.AppendFormat("Drawer_Type = '{0}', ", arg); stringBuilder.AppendFormat("drawer_comport = '{0}', ", this.txtConfComPort.Text); stringBuilder.AppendFormat("drawer_kickercode1 = '{0}', ", this.txtConfDrawerCode1.Text); stringBuilder.AppendFormat("drawer_kickercode2 = '{0}', ", this.txtConfDrawerCode2.Text); stringBuilder.AppendFormat("drawer_kickercode3 = '{0}', ", this.txtConfDrawerCode3.Text); stringBuilder.AppendFormat("drawer_kickercode4 = '{0}', ", this.txtConfDrawerCode4.Text); stringBuilder.AppendFormat("drawer_kickercode5 = '{0}', ", this.txtConfDrawerCode5.Text); stringBuilder.AppendFormat("drawer_kickercode6 = '{0}', ", this.txtConfDrawerCode6.Text); stringBuilder.AppendFormat("drawer_kickercode7 = '{0}', ", this.txtConfDrawerCode7.Text); stringBuilder.AppendFormat("drawer_kickercode8 = '{0}', ", this.txtConfDrawerCode8.Text); stringBuilder.AppendFormat("drawer_slipprinter = '{0}', ", this.btnConfDrawerSlipPrinter.Text); stringBuilder.AppendFormat("PrintTo_CashInvoice = '{0}', ", this.btnConfPrintTo_CashInvoice.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_Refund = '{0}', ", this.btnConfPrintTo_Refund.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_Payout = '{0}', ", this.btnConfPrintTo_Payout.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_AccInvoice = '{0}', ", this.btnConfPrintTo_AccInvoice.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_CreditNote = '{0}', ", this.btnConfPrintTo_CreditNote.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_Receipt = '{0}', ", this.btnConfPrintTo_Receipt.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_Journal = '{0}', ", this.btnConfPrintTo_Journal.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_Quotation = '{0}', ", this.btnConfPrintTo_Quotation.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_ProformaInvoice = '{0}', ", this.btnConfPrintTo_ProformaInvoice.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_IBT = '{0}', ", this.btnConfPrintTo_IBT.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_IBTreturn = '{0}', ", this.btnConfPrintTo_IBTreturn.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_CashPurchase = '{0}', ", this.btnConfPrintTo_CashPurchase.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_CashPurchaseReturn = '{0}', ", this.btnConfPrintTo_CashPurchaseReturn.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_AccPurchase = '{0}', ", this.btnConfPrintTo_AccPurchase.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_DebitNote = '{0}', ", this.btnConfPrintTo_DebitNote.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_Payment = '{0}', ", this.btnConfPrintTo_Payment.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_CreditorJournal = '{0}', ", this.btnConfPrintTo_CreditorJournal.Text.Replace("\\", "|")); stringBuilder.AppendFormat("PrintTo_PurchaseOrder = '{0}'", this.btnConfPrintTo_PurchaseOrder.Text.Replace("\\", "|")); this.cmmMySql.CommandText = string.Format("UPDATE workstation_config SET {0} WHERE CompanyID = {1} AND (ComputerName = '{2}' OR ComputerIP = '{3}');", new object[] { stringBuilder.ToString(), CompanyID, this.GetComputerName(), this.GetCurrentIP() }); int num = this.cmmMySql.ExecuteNonQuery(); if (num == 0) { this.cmmMySql.CommandText = string.Format("INSERT INTO workstation_config SET {0}, ComputerName = '{1}', ComputerIP = '{2}';", stringBuilder.ToString(), this.GetComputerName(), this.GetCurrentIP()); this.cmmMySql.ExecuteNonQuery(); } } catch (Exception ex) { this.ShowMessage("Cannot save workstation hardware configuration.", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); } } // Token: 0x060000C1 RID: 193 RVA: 0x00011018 File Offset: 0x0000F218 private void LoadWorkstationConfig(int CompanyID) { try { this.cmmMySql.CommandText = string.Format("SELECT * FROM workstation_config WHERE CompanyID = {0} AND (ComputerName = '{1}' OR ComputerIP = '{2}')", CompanyID, this.GetComputerName(), this.GetCurrentIP()); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { this.drMySql.Read(); string @string = this.drMySql.GetString("Drawer_Type"); Console.WriteLine("Cash drawer type:" + @string); if (string.Compare(@string, "none", true) == 0) { this.btnConfDrawer_Type.Text = "None"; } else if (string.Compare(@string, "usb", true) == 0) { this.btnConfDrawer_Type.Text = "USB to Com/Com"; } else if (string.Compare(@string, "rj11", true) == 0) { this.btnConfDrawer_Type.Text = "RJ11 (back of slip printer)"; } this.txtConfComPort.Text = this.drMySql.GetString("Drawer_Comport"); this.txtConfDrawerCode1.Text = this.drMySql.GetString("Drawer_Kickercode1"); this.txtConfDrawerCode2.Text = this.drMySql.GetString("Drawer_Kickercode2"); this.txtConfDrawerCode3.Text = this.drMySql.GetString("Drawer_Kickercode3"); this.txtConfDrawerCode4.Text = this.drMySql.GetString("Drawer_Kickercode4"); this.txtConfDrawerCode5.Text = this.drMySql.GetString("Drawer_Kickercode5"); this.txtConfDrawerCode6.Text = this.drMySql.GetString("Drawer_Kickercode6"); this.txtConfDrawerCode7.Text = this.drMySql.GetString("Drawer_Kickercode7"); this.txtConfDrawerCode8.Text = this.drMySql.GetString("Drawer_Kickercode8"); this.btnConfDrawerSlipPrinter.Text = this.drMySql.GetString("Drawer_Slipprinter"); this.btnConfPrintTo_CashInvoice.Text = this.drMySql.GetString("PrintTo_CashInvoice").Replace("|", "\\"); this.btnConfPrintTo_Refund.Text = this.drMySql.GetString("PrintTo_Refund").Replace("|", "\\"); this.btnConfPrintTo_Payout.Text = this.drMySql.GetString("PrintTo_Payout").Replace("|", "\\"); this.btnConfPrintTo_AccInvoice.Text = this.drMySql.GetString("PrintTo_AccInvoice").Replace("|", "\\"); this.btnConfPrintTo_CreditNote.Text = this.drMySql.GetString("PrintTo_CreditNote").Replace("|", "\\"); this.btnConfPrintTo_Receipt.Text = this.drMySql.GetString("PrintTo_Receipt").Replace("|", "\\"); this.btnConfPrintTo_Journal.Text = this.drMySql.GetString("PrintTo_Journal").Replace("|", "\\"); this.btnConfPrintTo_Quotation.Text = this.drMySql.GetString("PrintTo_Quotation").Replace("|", "\\"); this.btnConfPrintTo_ProformaInvoice.Text = this.drMySql.GetString("PrintTo_ProformaInvoice").Replace("|", "\\"); this.btnConfPrintTo_IBT.Text = this.drMySql.GetString("PrintTo_IBT").Replace("|", "\\"); this.btnConfPrintTo_IBTreturn.Text = this.drMySql.GetString("PrintTo_IBTreturn").Replace("|", "\\"); this.btnConfPrintTo_CashPurchase.Text = this.drMySql.GetString("PrintTo_CashPurchase").Replace("|", "\\"); this.btnConfPrintTo_CashPurchaseReturn.Text = this.drMySql.GetString("PrintTo_CashPurchaseReturn").Replace("|", "\\"); this.btnConfPrintTo_AccPurchase.Text = this.drMySql.GetString("PrintTo_AccPurchase").Replace("|", "\\"); this.btnConfPrintTo_DebitNote.Text = this.drMySql.GetString("PrintTo_DebitNote").Replace("|", "\\"); this.btnConfPrintTo_Payment.Text = this.drMySql.GetString("PrintTo_Payment").Replace("|", "\\"); this.btnConfPrintTo_CreditorJournal.Text = this.drMySql.GetString("PrintTo_CreditorJournal").Replace("|", "\\"); this.btnConfPrintTo_PurchaseOrder.Text = this.drMySql.GetString("PrintTo_PurchaseOrder").Replace("|", "\\"); } this.drMySql.Close(); } catch (Exception ex) { this.Cursor = Cursors.Default; this.ShowMessage("Problem loading workstation configuration", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); } } // Token: 0x060000C2 RID: 194 RVA: 0x000115A0 File Offset: 0x0000F7A0 private void optConfCompanyInfo_CheckedChanged(object sender, EventArgs e) { this.btnRemove.Visible = false; if (this.optConfCompanyInfo.Checked) { this.optConfCompanyInfo.Image = Resources.Right; } else { this.optConfCompanyInfo.Image = null; } this.tlpCompanyDetails.Visible = this.optConfCompanyInfo.Checked; this.tlpCompanyDetails.ScrollControlIntoView(this.txtCompanyName); this.txtCompanyName.Focus(); } // Token: 0x060000C3 RID: 195 RVA: 0x00011628 File Offset: 0x0000F828 private void optConfSalesRelatedOptions_CheckedChanged(object sender, EventArgs e) { this.btnRemove.Visible = false; if (this.optConfSalesRelatedOptions.Checked) { this.optConfSalesRelatedOptions.Image = Resources.Right; } else { this.optConfSalesRelatedOptions.Image = null; } this.tlpConfSalesRelated_0.Visible = this.optConfSalesRelatedOptions.Checked; this.tlpConfigure.ScrollControlIntoView(this.label24); this.btnConfSales_UnderCost.Focus(); } // Token: 0x060000C4 RID: 196 RVA: 0x000116B0 File Offset: 0x0000F8B0 private void optConfPurchaseRelatedOptions_CheckedChanged(object sender, EventArgs e) { this.btnRemove.Visible = false; if (this.optConfPurchaseRelatedOptions.Checked) { this.optConfPurchaseRelatedOptions.Image = Resources.Right; } else { this.optConfPurchaseRelatedOptions.Image = null; } this.tlpConfPurchaseRelated.Visible = this.optConfPurchaseRelatedOptions.Checked; this.tlpConfigure.ScrollControlIntoView(this.label65); this.btnConfPurchase_DefaultTrans.Focus(); } // Token: 0x060000C5 RID: 197 RVA: 0x00011738 File Offset: 0x0000F938 private void optConfItemOptions_CheckedChanged(object sender, EventArgs e) { this.btnRemove.Visible = false; if (this.optConfItemOptions.Checked) { this.optConfItemOptions.Image = Resources.Right; } else { this.optConfItemOptions.Image = null; } this.tlpConfItemOptions.Visible = this.optConfItemOptions.Checked; this.tlpConfItemOptions.ScrollControlIntoView(this.btnConfLabel_PrintTo); this.btnConfLabel_PrintTo.Focus(); } // Token: 0x060000C6 RID: 198 RVA: 0x000117C0 File Offset: 0x0000F9C0 private void optConfGeneral_CheckedChanged(object sender, EventArgs e) { this.btnRemove.Visible = false; if (this.optConfGeneral.Checked) { this.optConfGeneral.Image = Resources.Right; } else { this.optConfGeneral.Image = null; } this.tlpConfGeneral.Visible = this.optConfGeneral.Checked; this.tlpConfigure.ScrollControlIntoView(this.chkIsPortableDatabase); this.btnConfEmailAccounts.Focus(); } // Token: 0x060000C7 RID: 199 RVA: 0x00011848 File Offset: 0x0000FA48 private void optConfUsers_CheckedChanged(object sender, EventArgs e) { this.btnRemove.Visible = true; if (this.optConfUsers.Checked) { this.optConfUsers.Image = Resources.Right; } else { this.optConfUsers.Image = null; } this.tlpUserDetails.Visible = this.optConfUsers.Checked; this.tlpUserDetails.ScrollControlIntoView(this.lvConfUsers); this.lvConfUsers.Focus(); this.lvConfUsers.Items[0].Selected = true; } // Token: 0x060000C8 RID: 200 RVA: 0x000118E8 File Offset: 0x0000FAE8 private void btnConfSales_UnderCost_Click(object sender, EventArgs e) { this.AddPopupButton("Do nothing", string.Empty, 0, false, true); this.AddPopupButton("Warn the user", string.Empty, 0, false, true); this.AddPopupButton("Prevent the user", string.Empty, 0, false, true); this.ShowPopup(this.btnConfSales_UnderCost, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000C9 RID: 201 RVA: 0x00011944 File Offset: 0x0000FB44 private void btnConfSales_SellingOverQty_Click(object sender, EventArgs e) { this.AddPopupButton("Do nothing", string.Empty, 0, false, true); this.AddPopupButton("Warn the user", string.Empty, 0, false, true); this.AddPopupButton("Prevent the user", string.Empty, 0, false, true); this.ShowPopup(this.btnConfSales_SellingOverQty, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000CA RID: 202 RVA: 0x0001199F File Offset: 0x0000FB9F private void btnConfSales_ShowVAT_Click(object sender, EventArgs e) { this.AddPopupButton("Excluding VAT", string.Empty, 0, false, true); this.AddPopupButton("Including VAT", string.Empty, 0, false, true); this.ShowPopup(this.btnConfSales_ShowVAT, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000CB RID: 203 RVA: 0x000119DC File Offset: 0x0000FBDC private void btnConfSales_DefaultTrans_Click(object sender, EventArgs e) { this.AddPopupButton("Cash Invoice", string.Empty, 0, false, true); this.AddPopupButton("Account Invoice", string.Empty, 0, false, true); this.AddPopupButton("Let me choose", string.Empty, 0, false, true); this.ShowPopup(this.btnConfSales_DefaultTrans, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000CC RID: 204 RVA: 0x00011A38 File Offset: 0x0000FC38 private void btnConfAfterAddingNewItemToGridDo_Click(object sender, EventArgs e) { this.AddPopupButton("Goto a new line", string.Empty, 0, false, true); this.AddPopupButton("Goto the Qty column", string.Empty, 0, false, true); this.AddPopupButton("Goto the Price column", string.Empty, 0, false, true); this.ShowPopup(this.btnConfAfterAddingNewItemToGridDo, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000CD RID: 205 RVA: 0x00011A94 File Offset: 0x0000FC94 private void btnConfEmailAccounts_Click(object sender, EventArgs e) { this.AddPopupButton("", string.Empty, 0, false, true); this.AddPopupButton(" ABSA", string.Empty, 0, false, true); this.AddPopupButton(" @lantic", string.Empty, 0, false, true); this.AddPopupButton(" Cell C", string.Empty, 0, false, true); this.AddPopupButton(" Gmail", string.Empty, 0, false, true); this.AddPopupButton(" Hotmail", string.Empty, 0, false, true); this.AddPopupButton(" MTN", string.Empty, 0, false, true); this.AddPopupButton(" MWEB", string.Empty, 0, false, true); this.AddPopupButton(" SAOL", string.Empty, 0, false, true); this.AddPopupButton(" Telkom SA", string.Empty, 0, false, true); this.AddPopupButton(" Vodacom", string.Empty, 0, false, true); this.AddPopupButton(" Yahoo", string.Empty, 0, false, true); this.AddPopupButton(" Other", string.Empty, 0, false, true); this.ShowPopup(this.btnConfEmailAccounts, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000CE RID: 206 RVA: 0x00011BB8 File Offset: 0x0000FDB8 private void btnConfEmailAccounts_TextChanged(object sender, EventArgs e) { if (string.Compare(this.btnConfEmailAccounts.Text, "hotmail", true) == 0) { this.txtConfEmailSMTPPort.Text = "587"; this.txtConfEmailSMTPAddress.Text = "smtp.live.com"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "yahoo", true) == 0) { this.txtConfEmailSMTPPort.Text = "587"; this.txtConfEmailSMTPAddress.Text = "smtp.mail.yahoo.com"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "gmail", true) == 0) { this.txtConfEmailSMTPPort.Text = "587"; this.txtConfEmailSMTPAddress.Text = "smtp.gmail.com"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "telkom", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "smtp.saix.net"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "vodacom", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "smtp.vodacom.co.za"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "mtn", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "mail.mtn.co.za"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "cell", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "mail.cmobile.co.za"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "mweb", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "smtp.mweb.net"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "absa", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "mail.absa.co.za"; } else if (string.Compare(this.btnConfEmailAccounts.Text, "saol", true) == 0) { this.txtConfEmailSMTPPort.Text = "25"; this.txtConfEmailSMTPAddress.Text = "smtp.saol.co.za"; } else { this.txtConfEmailSMTPPort.Text = string.Empty; this.txtConfEmailSMTPAddress.Text = string.Empty; } } // Token: 0x060000CF RID: 207 RVA: 0x00011EC0 File Offset: 0x000100C0 private void SetDrawerConfigType() { if (string.Compare(this.btnConfDrawer_Type.Text, "None", true) == 0) { this.lblConfComPort.Enabled = false; this.txtConfComPort.Enabled = false; this.lblDrawerCode.Enabled = false; this.tlpDrawerCode.Enabled = false; this.lblConfDrawerSlipPrinter.Enabled = false; this.btnConfDrawerSlipPrinter.Enabled = false; this.btnDrawerTest.Enabled = false; } else if (string.Compare(this.btnConfDrawer_Type.Text, "USB to Com/Com", true) == 0) { this.lblConfComPort.Enabled = true; this.txtConfComPort.Enabled = true; this.lblDrawerCode.Enabled = true; this.tlpDrawerCode.Enabled = true; this.lblConfDrawerSlipPrinter.Enabled = false; this.btnConfDrawerSlipPrinter.Enabled = false; this.btnDrawerTest.Enabled = true; } else if (string.Compare(this.btnConfDrawer_Type.Text, "RJ11 (back of slip printer)", true) == 0) { this.lblConfComPort.Enabled = false; this.txtConfComPort.Enabled = false; this.lblDrawerCode.Enabled = true; this.tlpDrawerCode.Enabled = true; this.lblConfDrawerSlipPrinter.Enabled = true; this.btnConfDrawerSlipPrinter.Enabled = true; this.btnDrawerTest.Enabled = true; } } // Token: 0x060000D0 RID: 208 RVA: 0x0001204C File Offset: 0x0001024C private void btnDrawerTest_Click(object sender, EventArgs e) { this.OpenCashDrawer(); } // Token: 0x060000D1 RID: 209 RVA: 0x00012058 File Offset: 0x00010258 private void btnConfDrawerReset_Click(object sender, EventArgs e) { this.btnConfDrawer_Type.Text = "None"; this.txtConfComPort.Text = "1"; this.txtConfDrawerCode1.Text = "27"; this.txtConfDrawerCode2.Text = "112"; this.txtConfDrawerCode3.Text = "0"; this.txtConfDrawerCode4.Text = "100"; this.txtConfDrawerCode5.Text = "100"; this.txtConfDrawerCode6.Text = "0"; this.txtConfDrawerCode7.Text = "0"; this.txtConfDrawerCode8.Text = "0"; this.btnConfDrawerSlipPrinter.Text = string.Empty; } // Token: 0x060000D2 RID: 210 RVA: 0x00012124 File Offset: 0x00010324 private void OpenCashDrawer() { try { SerialPort serialPort = new SerialPort(); if (string.Compare(this.btnConfDrawer_Type.Text, "USB to Com/Com", true) == 0) { int num = Convert.ToInt32(this.txtConfDrawerCode1.Text); int num2 = Convert.ToInt32(this.txtConfDrawerCode2.Text); int num3 = Convert.ToInt32(this.txtConfDrawerCode3.Text); int num4 = Convert.ToInt32(this.txtConfDrawerCode4.Text); int num5 = Convert.ToInt32(this.txtConfDrawerCode5.Text); int num6 = Convert.ToInt32(this.txtConfDrawerCode6.Text); int num7 = Convert.ToInt32(this.txtConfDrawerCode7.Text); int num8 = Convert.ToInt32(this.txtConfDrawerCode8.Text); char c = (char)num; char c2 = (char)num2; char c3 = (char)num3; char c4 = (char)num4; char c5 = (char)num5; char c6 = (char)num6; char c7 = (char)num7; char c8 = (char)num8; serialPort.PortName = "COM" + this.txtConfComPort.Text; serialPort.Open(); serialPort.Write(string.Concat(new object[] { c, c2, c3, c4, c5, c6, c7, c8 })); serialPort.Close(); } else if (string.Compare(this.btnConfDrawer_Type.Text, "RJ11 (back of slip printer)", true) == 0) { int num = Convert.ToInt32(this.txtConfDrawerCode1.Text); int num2 = Convert.ToInt32(this.txtConfDrawerCode2.Text); int num3 = Convert.ToInt32(this.txtConfDrawerCode3.Text); int num4 = Convert.ToInt32(this.txtConfDrawerCode4.Text); int num5 = Convert.ToInt32(this.txtConfDrawerCode5.Text); int num6 = Convert.ToInt32(this.txtConfDrawerCode6.Text); int num7 = Convert.ToInt32(this.txtConfDrawerCode7.Text); int num8 = Convert.ToInt32(this.txtConfDrawerCode8.Text); char c = (char)num; char c2 = (char)num2; char c3 = (char)num3; char c4 = (char)num4; char c5 = (char)num5; char c6 = (char)num6; char c7 = (char)num7; char c8 = (char)num8; string szString = string.Concat(new object[] { c, c2, c3, c4, c5, c6, c7, c8 }); string szPrinterName = string.Empty; PrintDocument printDocument = new PrintDocument(); for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++) { string printerName = PrinterSettings.InstalledPrinters[i]; printDocument.PrinterSettings.PrinterName = printerName; if (printDocument.PrinterSettings.IsDefaultPrinter) { szPrinterName = printDocument.PrinterSettings.PrinterName; } } if (string.Compare("use default printer", this.btnConfDrawerSlipPrinter.Text.Trim(), true) == 0) { OpenRJ11CashDrawer.SendStringToPrinter(szPrinterName, szString); } else { OpenRJ11CashDrawer.SendStringToPrinter(this.btnConfDrawerSlipPrinter.Text, szString); } } } catch (Exception ex) { this.ShowMessage("Problem opening cash drawer.", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); } } // Token: 0x060000D3 RID: 211 RVA: 0x000124F4 File Offset: 0x000106F4 private void btnConfDrawerSlipPrinter_Click(object sender, EventArgs e) { this.LoadAvailablePrinters(this.btnConfDrawerSlipPrinter, frm.menuWidth.CallerWidth); } // Token: 0x060000D4 RID: 212 RVA: 0x00012508 File Offset: 0x00010708 private void btnConfQtyDecimals_Click(object sender, EventArgs e) { this.AddPopupButton("0", string.Empty, 0, false, true); this.AddPopupButton("1", string.Empty, 0, false, true); this.AddPopupButton("2", string.Empty, 0, false, true); this.ShowPopup(this.btnConfQtyDecimals, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000D5 RID: 213 RVA: 0x00012564 File Offset: 0x00010764 private void btnRoundToValue_Click(object sender, EventArgs e) { this.AddPopupButton("0", string.Empty, 0, false, true); this.AddPopupButton("5", string.Empty, 0, false, true); this.AddPopupButton("10", string.Empty, 0, false, true); this.AddPopupButton("50", string.Empty, 0, false, true); this.ShowPopup(this.btnRoundToValue, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000D6 RID: 214 RVA: 0x000125D4 File Offset: 0x000107D4 private void btnPriceEmbeddedPrefix_Click(object sender, EventArgs e) { this.AddPopupButton("", string.Empty, 0, false, true); this.AddPopupButton("0", string.Empty, 0, false, true); this.AddPopupButton("1", string.Empty, 0, false, true); this.AddPopupButton("2", string.Empty, 0, false, true); this.AddPopupButton("3", string.Empty, 0, false, true); this.AddPopupButton("4", string.Empty, 0, false, true); this.AddPopupButton("5", string.Empty, 0, false, true); this.AddPopupButton("6", string.Empty, 0, false, true); this.AddPopupButton("7", string.Empty, 0, false, true); this.AddPopupButton("8", string.Empty, 0, false, true); this.AddPopupButton("9", string.Empty, 0, false, true); this.ShowPopup(this.btnPriceEmbeddedPrefix, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000D7 RID: 215 RVA: 0x000126D0 File Offset: 0x000108D0 private void txtQuotationDefaultName_Leave(object sender, EventArgs e) { if (this.txtQuotationDefaultName.Text.Length == 0) { this.txtQuotationDefaultName.Text = "Quotation"; } } // Token: 0x060000D8 RID: 216 RVA: 0x0001270C File Offset: 0x0001090C private void txtProformaDefaultName_Leave(object sender, EventArgs e) { if (this.txtProformaDefaultName.Text.Length == 0) { this.txtProformaDefaultName.Text = "Proforma Invoice"; } } // Token: 0x060000D9 RID: 217 RVA: 0x00012748 File Offset: 0x00010948 private void chkAllowSalesDiscount_Click(object sender, EventArgs e) { this.chkShowDiscountOnSalesDocument.Visible = this.chkAllowSalesDiscount.Checked; if (!this.chkAllowSalesDiscount.Checked) { this.chkShowDiscountOnSalesDocument.Checked = false; } } // Token: 0x060000DA RID: 218 RVA: 0x0001278C File Offset: 0x0001098C private void btnConfPurchase_DefaultTrans_Click(object sender, EventArgs e) { this.AddPopupButton("Cash Purchase", string.Empty, 0, false, true); this.AddPopupButton("Account Purchase", string.Empty, 0, false, true); this.AddPopupButton("Let me choose", string.Empty, 0, false, true); this.ShowPopup(this.btnConfPurchase_DefaultTrans, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000DB RID: 219 RVA: 0x000127E8 File Offset: 0x000109E8 private void btnConfAfterAddingNewItemToGridDo_Purchases_Click(object sender, EventArgs e) { this.AddPopupButton("Goto a new line", string.Empty, 0, false, true); this.AddPopupButton("Goto the Qty column", string.Empty, 0, false, true); this.AddPopupButton("Goto the Price column", string.Empty, 0, false, true); this.ShowPopup(this.btnConfAfterAddingNewItemToGridDo_Purchases, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000DC RID: 220 RVA: 0x00012843 File Offset: 0x00010A43 private void btnDefaultPrinterPurchase_Click(object sender, EventArgs e) { this.LoadAvailablePrinters((Button)sender, frm.menuWidth.Auto); } // Token: 0x060000DD RID: 221 RVA: 0x00012854 File Offset: 0x00010A54 private void btnSlipSizePurchases_Click(object sender, EventArgs e) { this.ShowSlipSizeOptions((Button)sender); } // Token: 0x060000DE RID: 222 RVA: 0x00012864 File Offset: 0x00010A64 private void btnAfterTransDoPurchases_Click(object sender, EventArgs e) { this.ShowAfterTransOptions((Button)sender); } // Token: 0x060000DF RID: 223 RVA: 0x00012874 File Offset: 0x00010A74 private void chkAllowPurchaseDiscount_Click(object sender, EventArgs e) { this.chkShowDiscountOnPurchaseDocument.Visible = this.chkAllowPurchaseDiscount.Checked; if (!this.chkAllowPurchaseDiscount.Checked) { this.chkShowDiscountOnPurchaseDocument.Checked = false; } } // Token: 0x060000E0 RID: 224 RVA: 0x000128B8 File Offset: 0x00010AB8 private void btnConfItems_DefaultTrans_Click(object sender, EventArgs e) { this.AddPopupButton("Item Details", string.Empty, 0, false, true); this.AddPopupButton("Stock Take", string.Empty, 0, false, true); this.AddPopupButton("Let me choose", string.Empty, 0, false, true); this.ShowPopup(this.btnConfItems_DefaultTrans, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E1 RID: 225 RVA: 0x00012913 File Offset: 0x00010B13 private void btnPrintTo_Click(object sender, EventArgs e) { this.LoadAvailablePrinters(this.btnConfLabel_PrintTo, frm.menuWidth.CallerWidth); } // Token: 0x060000E2 RID: 226 RVA: 0x00012924 File Offset: 0x00010B24 private void btnUseThisLabel_Click(object sender, EventArgs e) { string path = AppDomain.CurrentDomain.BaseDirectory + "\\Programs\\Labels"; if (Directory.Exists(path)) { string[] files = Directory.GetFiles(path); foreach (string path2 in files) { this.AddPopupButton(Path.GetFileNameWithoutExtension(path2), string.Empty, 0, false, true); } this.ShowPopup(this.btnUseThisLabel, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } else { this.ShowMessage("Cannot find the Labels folder", "The labels folder should be located in the Programs folder.\nIt might have been removed.", "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } } // Token: 0x060000E3 RID: 227 RVA: 0x000129CC File Offset: 0x00010BCC private void btnConfRetailPrice_Click(object sender, EventArgs e) { this.AddPopupButton("Nothing", string.Empty, 0, false, true); this.AddPopupButton("Inclusive", string.Empty, 0, false, true); this.AddPopupButton("Exclusive", string.Empty, 0, false, true); this.ShowPopup(this.btnConfLabel_RetailPrice, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E4 RID: 228 RVA: 0x00012A27 File Offset: 0x00010C27 private void btnConfCustom1_Click(object sender, EventArgs e) { this.AddPopupButton("Nothing", string.Empty, 0, false, true); this.AddPopupButton("Qty Available", string.Empty, 0, false, true); this.ShowPopup(this.btnConfLabel_Custom1, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E5 RID: 229 RVA: 0x00012A63 File Offset: 0x00010C63 private void btnConfCustom2_Click(object sender, EventArgs e) { this.AddPopupButton("Nothing", string.Empty, 0, false, true); this.AddPopupButton("Current Date", string.Empty, 0, false, true); this.ShowPopup(this.btnConfLabel_Custom2, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E6 RID: 230 RVA: 0x00012AA0 File Offset: 0x00010CA0 private void btnConfCustom3_Click(object sender, EventArgs e) { this.AddPopupButton("Nothing", string.Empty, 0, false, true); this.AddPopupButton("Location", string.Empty, 0, false, true); this.AddPopupButton("SubLocation", string.Empty, 0, false, true); this.AddPopupButton("Category", string.Empty, 0, false, true); this.AddPopupButton("SubCategory", string.Empty, 0, false, true); this.ShowPopup(this.btnConfLabel_Custom3, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E7 RID: 231 RVA: 0x00012B24 File Offset: 0x00010D24 private void btnConfStockTake_DefaultTrans_Click(object sender, EventArgs e) { this.AddPopupButton("Wall to Wall", string.Empty, 0, false, true); this.AddPopupButton("Location", string.Empty, 0, false, true); this.AddPopupButton("Sub-Location", string.Empty, 0, false, true); this.AddPopupButton("Category", string.Empty, 0, false, true); this.AddPopupButton("Sub-Category", string.Empty, 0, false, true); this.ShowPopup(this.btnConfStockTake_DefaultTrans, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E8 RID: 232 RVA: 0x00012BA8 File Offset: 0x00010DA8 private void btnStockTake_AfterSavingSheet_Click(object sender, EventArgs e) { this.AddPopupButton(" Do nothing", "stocktake_do_nothing", 0, true, true); this.AddPopupButton(" View variance report", "stocktake_view_variance", 0, true, true); this.AddPopupButton(" Print variance report", "stocktake_print_variance", 0, true, true); this.ShowPopup(this.btnStockTake_AfterSavingSheet, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000E9 RID: 233 RVA: 0x00012C03 File Offset: 0x00010E03 private void btnStockTake_VarianceOrderBy_Click(object sender, EventArgs e) { this.AddPopupButton(" Order variances by Description", string.Empty, 0, false, true); this.AddPopupButton(" Order variances by Item Code", string.Empty, 0, false, true); this.ShowPopup(this.btnStockTake_VarianceOrderBy, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000EA RID: 234 RVA: 0x00012C3F File Offset: 0x00010E3F private void StockTake_VarianceShow_Click(object sender, EventArgs e) { this.AddPopupButton(" Show only variances", string.Empty, 0, false, true); this.AddPopupButton(" Show all items", string.Empty, 0, false, true); this.ShowPopup(this.btnStockTake_VarianceShow, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000EB RID: 235 RVA: 0x00012C7B File Offset: 0x00010E7B private void btnLinkedItemsOptions_Click(object sender, EventArgs e) { this.AddPopupButton(" Hide linked items", string.Empty, 0, false, true); this.AddPopupButton(" Show linked items", string.Empty, 0, false, true); this.ShowPopup(this.btnLinkedItemsOptions, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000EC RID: 236 RVA: 0x00012CB8 File Offset: 0x00010EB8 private void btnConfDrawer_Type_Click(object sender, EventArgs e) { this.AddPopupButton("None", "drawer_type", 0, true, true); this.AddPopupButton("USB to Com/Com", "drawer_type", 0, true, true); this.AddPopupButton("RJ11 (back of slip printer)", "drawer_type", 0, true, true); this.ShowPopup(this.btnConfDrawer_Type, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.CallerWidth); } // Token: 0x060000ED RID: 237 RVA: 0x00012D14 File Offset: 0x00010F14 private void txtCopies_Leave(object sender, EventArgs e) { if (((TextBox)sender).Text.Length == 0 || ((TextBox)sender).Text == "0") { ((TextBox)sender).Text = "1"; } } // Token: 0x060000EE RID: 238 RVA: 0x00012D68 File Offset: 0x00010F68 private void txtCopies_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '.') { e.Handled = true; } else if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; } } // Token: 0x060000EF RID: 239 RVA: 0x00012DBC File Offset: 0x00010FBC private void btnDefaultPrinter_Click(object sender, EventArgs e) { this.LoadAvailablePrinters((Button)sender, frm.menuWidth.Auto); } // Token: 0x060000F0 RID: 240 RVA: 0x00012DD0 File Offset: 0x00010FD0 private void LoadAvailablePrinters(Control CallingControl, frm.menuWidth MenuWidth) { this.AddPopupButton(" Use Default Printer", string.Empty, 0, false, true); for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++) { string str = PrinterSettings.InstalledPrinters[i]; this.AddPopupButton(" " + str, string.Empty, 0, false, true); } this.ShowPopup(CallingControl, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, MenuWidth); } // Token: 0x060000F1 RID: 241 RVA: 0x00012E3F File Offset: 0x0001103F private void btnSlipSize_Click(object sender, EventArgs e) { this.ShowSlipSizeOptions((Button)sender); } // Token: 0x060000F2 RID: 242 RVA: 0x00012E50 File Offset: 0x00011050 public void ShowSlipSizeOptions(Control Caller) { this.AddPopupButton(" A4", string.Empty, 0, false, true); this.AddPopupButton(" A5", string.Empty, 0, false, true); this.AddPopupButton(" Slip", string.Empty, 0, false, true); this.ShowPopup(Caller, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.Auto); } // Token: 0x060000F3 RID: 243 RVA: 0x00012EA6 File Offset: 0x000110A6 private void btnAfterTransDo_Click(object sender, EventArgs e) { this.ShowAfterTransOptions((Button)sender); } // Token: 0x060000F4 RID: 244 RVA: 0x00012EB8 File Offset: 0x000110B8 private void ShowAfterTransOptions(Control Caller) { this.AddPopupButton(" Do nothing", string.Empty, 0, false, true); this.AddPopupButton(" Print document", string.Empty, 0, false, true); this.AddPopupButton(" Email document", string.Empty, 0, false, true); this.AddPopupButton(" Save document as PDF", string.Empty, 0, false, true); this.ShowPopup(Caller, frm.menuLocation.OverCaller, frm.colorScheme.MainForm, frm.menuOffset.Left, frm.menuWidth.Auto); } // Token: 0x060000F5 RID: 245 [DllImport("user32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool SetForegroundWindow(IntPtr hwnd); // Token: 0x060000F6 RID: 246 [DllImport("user32.dll")] private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); // Token: 0x060000F7 RID: 247 [DllImport("user32.dll")] private static extern int BringWindowToTop(IntPtr hwnd); // Token: 0x060000F8 RID: 248 [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); // Token: 0x060000F9 RID: 249 [DllImport("kernel32.dll")] private static extern uint GetCurrentThreadId(); // Token: 0x060000FA RID: 250 [DllImport("user32.dll", SetLastError = true)] private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); // Token: 0x060000FB RID: 251 [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId); // Token: 0x060000FC RID: 252 [DllImport("User32.dll")] private static extern int AttachThreadInput(uint CurrentForegroundThread, uint MakeThisThreadForegrouond, bool boolAttach); // Token: 0x060000FD RID: 253 RVA: 0x00012F24 File Offset: 0x00011124 private static void ForceForegroundWindow(IntPtr hWnd, int Status) { uint windowThreadProcessId = frm.GetWindowThreadProcessId(frm.GetForegroundWindow(), IntPtr.Zero); uint currentThreadId = frm.GetCurrentThreadId(); if (windowThreadProcessId != currentThreadId) { frm.AttachThreadInput(windowThreadProcessId, currentThreadId, true); frm.BringWindowToTop(hWnd); frm.ShowWindow(hWnd, Status); frm.AttachThreadInput(windowThreadProcessId, currentThreadId, false); } else { frm.BringWindowToTop(hWnd); frm.ShowWindow(hWnd, Status); } } // Token: 0x060000FE RID: 254 RVA: 0x00012F88 File Offset: 0x00011188 private void InitializeNotification() { this.FrmNotification.ShowInTaskbar = false; this.FrmNotification.FormBorderStyle = FormBorderStyle.None; this.FrmNotification.BackColor = Color.FromArgb(0, 127, 36); this.FrmNotification.Height = 260; this.FrmNotification.Controls.Add(this.tlpNotification); this.FrmNotification.StartPosition = FormStartPosition.Manual; this.tlpNotification.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); this.tlpNotification.ColumnCount = 3; this.tlpNotification.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50f)); this.tlpNotification.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); this.tlpNotification.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50f)); this.tlpNotification.Controls.Add(this.lblNotificationMessage, 1, 1); this.tlpNotification.Controls.Add(this.lblNotificationSubMessage, 1, 2); this.tlpNotification.Name = "tlpNotification"; this.tlpNotification.RowCount = 4; this.tlpNotification.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tlpNotification.RowStyles.Add(new RowStyle(SizeType.AutoSize)); this.tlpNotification.RowStyles.Add(new RowStyle(SizeType.AutoSize)); this.tlpNotification.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.lblNotificationMessage.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.lblNotificationMessage.AutoSize = true; this.lblNotificationMessage.Font = new Font("Segoe UI", 20f); this.lblNotificationMessage.ForeColor = Color.WhiteSmoke; this.lblNotificationMessage.Location = new Point(123, 71); this.lblNotificationMessage.Size = new Size(139, 37); this.lblNotificationMessage.Text = string.Empty; this.lblNotificationSubMessage.Anchor = (AnchorStyles.Left | AnchorStyles.Right); this.lblNotificationSubMessage.AutoSize = true; this.lblNotificationSubMessage.Font = new Font("Segoe UI", 11f); this.lblNotificationSubMessage.ForeColor = Color.WhiteSmoke; this.lblNotificationSubMessage.Location = new Point(123, 71); this.lblNotificationSubMessage.Size = new Size(139, 37); this.lblNotificationSubMessage.Text = string.Empty; this.tNotifyWait = new System.Windows.Forms.Timer(); this.tNotifyWait.Interval = 2500; this.tNotifyWait.Tick += this.tNotifyWait_Tick; this.tNotifyHide = new System.Windows.Forms.Timer(); this.tNotifyHide.Interval = 10; this.tNotifyHide.Tick += this.tNotifyHide_Tick; } // Token: 0x060000FF RID: 255 RVA: 0x00013290 File Offset: 0x00011490 public void ShowNotification(string message, string subMessage, frm.NotificationColor notfiColor) { this.FrmNotification.Width = base.Width; if (notfiColor == frm.NotificationColor.Green) { this.FrmNotification.BackColor = Color.Green; } else if (notfiColor == frm.NotificationColor.Blue) { this.FrmNotification.BackColor = Color.Blue; } else if (notfiColor == frm.NotificationColor.Red) { this.FrmNotification.BackColor = Color.DarkRed; } this.lblNotificationMessage.Text = message; this.lblNotificationSubMessage.Text = subMessage; this.FrmNotification.Top = base.Top; this.FrmNotification.Height = 100; this.tlpNotification.Height = this.FrmNotification.Height; this.tlpNotification.Width = this.FrmNotification.Width; this.FrmNotification.TopMost = true; this.FrmNotification.Visible = false; this.FrmNotification.Show(this); this.tNotifyWait.Start(); } // Token: 0x06000100 RID: 256 RVA: 0x000133A9 File Offset: 0x000115A9 private void tNotifyWait_Tick(object sender, EventArgs e) { this.tNotifyWait.Stop(); this.tNotifyHide.Start(); } // Token: 0x06000101 RID: 257 RVA: 0x000133C4 File Offset: 0x000115C4 private void tNotifyHide_Tick(object sender, EventArgs e) { if (this.FrmNotification.Top <= base.Top - this.FrmNotification.Height) { this.tNotifyHide.Stop(); this.FrmNotification.Hide(); } else { this.FrmNotification.Top -= 10; } } // Token: 0x06000102 RID: 258 RVA: 0x00013454 File Offset: 0x00011654 private void CreateButtonMenu() { this.flpMain.Controls.Clear(); string path = AppDomain.CurrentDomain.BaseDirectory + "Programs"; string[] files = Directory.GetFiles(path); IEnumerable enumerable = from file in files where file.EndsWith(".exe") || file.EndsWith(".lnk") select file; if (this.isMultiUser) { this.cmmMySql.CommandText = "SELECT UserID, ProgramsToUse, UserRights FROM `users` WHERE UserName = '" + this.lblSelUserName.Text + "'"; this.drMySql = this.cmmMySql.ExecuteReader(); int num = 0; string[] array = null; string[] array2 = null; if (this.drMySql.HasRows) { this.drMySql.Read(); num = this.drMySql.GetInt32("UserID"); array = this.drMySql.GetString("ProgramsToUse").Split(new char[] { '|' }); array2 = this.drMySql.GetString("UserRights").Split(new char[] { '|' }); } this.drMySql.Close(); if (num == 1) { this.configureProgram = true; this.useTools = true; foreach (string text in enumerable) { this.AddButtonToWrapPanel(text, Path.GetFileNameWithoutExtension(text), false); } } else { foreach (string text in enumerable) { for (int i = 0; i <= array.Length - 1; i++) { if (Path.GetFileNameWithoutExtension(text) == array[i]) { this.AddButtonToWrapPanel(text, Path.GetFileNameWithoutExtension(text), false); } } } for (int i = 0; i <= array2.Length - 1; i++) { if ("Do Configurations to this program" == array2[i]) { this.configureProgram = true; } else if ("Use Tools on Main Screen" == array2[i]) { this.useTools = true; } } } } else { this.configureProgram = true; this.useTools = true; foreach (string text in enumerable) { this.AddButtonToWrapPanel(text, Path.GetFileNameWithoutExtension(text), false); } } this.btnConfigure.Visible = this.configureProgram; this.btnTools.Visible = this.useTools; } // Token: 0x06000103 RID: 259 RVA: 0x000137B4 File Offset: 0x000119B4 private void AddButtonToWrapPanel(string buttonPathToProgram, string buttonText, bool directory) { if (!directory) { Button button = new Button(); button.FlatStyle = FlatStyle.Flat; button.TextAlign = ContentAlignment.MiddleLeft; button.Text = " " + buttonText.Replace('_', ' '); button.Font = new Font("Segoe UI Light", 20f); button.ForeColor = Color.White; button.FlatAppearance.BorderSize = 0; button.FlatAppearance.MouseOverBackColor = this.schemeMouseOver; button.Width = 400; button.Height = 80; button.Margin = new Padding(4, 4, 4, 4); button.Tag = buttonPathToProgram; button.TextImageRelation = TextImageRelation.ImageBeforeText; button.ImageAlign = ContentAlignment.MiddleLeft; try { string text = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Icons"; string[] files = Directory.GetFiles(text); IEnumerable enumerable = from file in files where file.EndsWith(".png") select file; foreach (string text2 in enumerable) { if (Path.GetFileNameWithoutExtension(text2).Replace('_', ' ') == buttonText.Replace('_', ' ')) { button.Image = new Bitmap(text2); } } if (button.Image == null) { button.Image = new Bitmap(text + "\\Default.png"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { button.Click += this.btnModel_Click; this.flpMain.Controls.Add(button); } } else { Label label = new Label(); label.Text = buttonText; label.TextAlign = ContentAlignment.MiddleLeft; label.BackColor = this.schemeBackColor; label.Font = new Font("Segoe UI SemiBold", 12f); label.ForeColor = Color.FromArgb(235, 135, 65); label.Width = this.flpMain.Width - 20; label.Height = 40; label.Margin = new Padding(0, 10, 0, 0); this.flpMain.Controls.Add(label); } } // Token: 0x06000104 RID: 260 RVA: 0x00013A70 File Offset: 0x00011C70 private void btnModel_Click(object sender, EventArgs e) { string fileName = ((Button)sender).Text.ToString(); string fullPath = ((Button)sender).Tag.ToString(); this.StartProgram(fileName, fullPath); } // Token: 0x06000105 RID: 261 RVA: 0x00013AAC File Offset: 0x00011CAC public void StartProgram(string fileName, string fullPath) { this.Cursor = Cursors.WaitCursor; Process process = new Process(); process.StartInfo.FileName = fullPath; process.StartInfo.UseShellExecute = true; try { bool flag = false; foreach (Process process2 in Process.GetProcesses()) { if (process2.ProcessName == Path.GetFileNameWithoutExtension(fullPath)) { if (string.Compare(Path.GetExtension(fullPath), ".lnk", true) == 0) { frm.ShowWindow(process2.MainWindowHandle, 1); frm.SetForegroundWindow(process2.MainWindowHandle); } else { frm.ForceForegroundWindow(process2.MainWindowHandle, 3); } flag = true; } } if (!flag) { process.Start(); } this.Cursor = Cursors.Default; } catch (Exception ex) { this.Cursor = Cursors.Default; this.ShowMessage("Could not start program", "The program: " + fileName + " failed to start with the following message:\n" + ex.Message, string.Empty, "Cancel", false, true, false, frm.MessageColor.Red); } } // Token: 0x06000106 RID: 262 RVA: 0x00013BF0 File Offset: 0x00011DF0 private void ShowUserLoginScreen() { this.flpUsers.Padding = new Padding(0, 0, this.vertScrollWidth, 0); this.AddUsersToPanel(); this.SetButtonBarState(frm.btnBarStates.UserLogin); this.txtLoginUserName.Focus(); } // Token: 0x06000107 RID: 263 RVA: 0x00013C28 File Offset: 0x00011E28 private int AddUsersToPanel() { int num = 0; this.flpUsers.Controls.Clear(); this.cmmMySql.CommandText = string.Format("SELECT UserName, Password, PictureName FROM `users` WHERE CompanyID = {0} AND UserName <> 'not in use'", this.currentCompanyID); this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { Button button = new Button(); button.FlatStyle = FlatStyle.Flat; button.TextAlign = ContentAlignment.MiddleCenter; button.Text = this.drMySql.GetString("UserName"); button.Font = new Font("Segoe UI", 11.25f); button.ForeColor = Color.White; button.FlatAppearance.BorderSize = 0; button.BackColor = this.schemeButtonColor; button.FlatAppearance.MouseOverBackColor = this.schemeMouseOver; button.Width = 220; button.Height = 80; button.Margin = new Padding(10, 4, 10, 4); button.Tag = this.drMySql.GetString("Password"); button.TextImageRelation = TextImageRelation.ImageBeforeText; button.ImageAlign = ContentAlignment.MiddleLeft; try { string str = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Pictures\\"; if (File.Exists(str + this.drMySql.GetString("PictureName"))) { button.Image = frm.ScaleImage(new Bitmap(str + this.drMySql.GetString("PictureName")), button.Height, button.Height); } else { button.Image = frm.ScaleImage(new Bitmap(str + "NoUser.png"), button.Height, button.Height); } } catch (Exception ex) { MessageBox.Show(ex.Message); } button.Click += this.btnUser_Click; this.flpUsers.Controls.Add(button); num++; } } this.drMySql.Close(); return num; } // Token: 0x06000108 RID: 264 RVA: 0x00013E78 File Offset: 0x00012078 private void btnUser_Click(object sender, EventArgs e) { this.btnNext.Visible = true; this.lblUserLoginError.Visible = false; this.txtUserLogin_Password.Visible = true; this.lblSelUserPassword.Text = ((Button)sender).Tag.ToString(); this.lblSelUserName.Text = ((Button)sender).Text.ToString(); this.txtUserLogin_Password.Focus(); this.lblSelUserMsg.Text = "Hi " + this.lblSelUserName.Text + ". Please provide your password."; this.lblSelUserMsg.Visible = true; } // Token: 0x06000109 RID: 265 RVA: 0x00013F24 File Offset: 0x00012124 private void VerifyUserLogin() { string text = this.txtUserLogin_Password.Text; using (MD5 md = MD5.Create()) { if (Encryption128bit.GetMd5Hash(md, text) == this.lblSelUserPassword.Text) { this.isConnected = true; this.userLoggedIn = this.lblSelUserName.Text; this.SetButtonBarState(frm.btnBarStates.StartUp); Application.DoEvents(); this.FinalizeProgramLoading(); this.Text = this.Text + " - " + this.lblSelUserName.Text; this.SaveCurrentUser(); } else { this.lblUserLoginError.Visible = true; this.lblUserLoginError.Text = "The password was incorrect, Please try again."; this.txtUserLogin_Password.Text = string.Empty; this.txtUserLogin_Password.Focus(); } } } // Token: 0x0600010A RID: 266 RVA: 0x00014020 File Offset: 0x00012220 private void SaveCurrentUser() { try { this.cmmMySql.CommandText = string.Format("DELETE FROM workstation_state WHERE (ComputerName = '{2}' OR ComputerIP = '{3}'); INSERT INTO workstation_state SET LastUserName = '{0}', CompanyID = {1}, ComputerName = '{2}', ComputerIP = '{3}'", new object[] { this.lblSelUserName.Text, this.currentCompanyID, this.GetComputerName(), this.GetCurrentIP() }); this.cmmMySql.ExecuteNonQuery(); } catch (Exception ex) { this.ShowMessage("Problem saving current logged-in user", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Blue); } } // Token: 0x0600010B RID: 267 RVA: 0x000140C0 File Offset: 0x000122C0 private void Update_WorkstationConfig() { if (!this.workstation_config_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".workstation_config "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '1',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`ComputerIP` varchar(45) NOT NULL default '',"); this.newTable.Append("`LastUserName` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Type` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Comport` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode6` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode7` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Kickercode8` varchar(45) NOT NULL default '',"); this.newTable.Append("`Drawer_Slipprinter` varchar(45) NOT NULL default '',"); this.newTable.Append("`PrintTo_CashInvoice` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Refund` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Payout` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_AccInvoice` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CreditNote` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Receipt` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Journal` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Quotation` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_ProformaInvoice` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_IBT` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_IBTreturn` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CashPurchase` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CashPurchaseReturn` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_AccPurchase` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_DebitNote` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Payment` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CreditorJournal` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_PurchaseOrder` varchar(45) NOT NULL default 'Use default printer',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; bool flag32 = false; bool flag33 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".workstation_config"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "ComputerName") { flag2 = true; } else if (this.strName == "ComputerIP") { flag3 = true; } else if (this.strName == "LastUserName") { flag4 = true; } else if (this.strName == "Drawer_Type") { flag5 = true; } else if (this.strName == "Drawer_Comport") { flag6 = true; } else if (this.strName == "Drawer_Kickercode1") { flag7 = true; } else if (this.strName == "Drawer_Kickercode2") { flag8 = true; } else if (this.strName == "Drawer_Kickercode3") { flag9 = true; } else if (this.strName == "Drawer_Kickercode4") { flag10 = true; } else if (this.strName == "Drawer_Kickercode5") { flag11 = true; } else if (this.strName == "Drawer_Kickercode6") { flag12 = true; } else if (this.strName == "Drawer_Kickercode7") { flag13 = true; } else if (this.strName == "Drawer_Kickercode8") { flag14 = true; } else if (this.strName == "Drawer_Slipprinter") { flag15 = true; } else if (this.strName == "PrintTo_CashInvoice") { flag16 = true; } else if (this.strName == "PrintTo_Refund") { flag17 = true; } else if (this.strName == "PrintTo_Payout") { flag18 = true; } else if (this.strName == "PrintTo_AccInvoice") { flag19 = true; } else if (this.strName == "PrintTo_CreditNote") { flag20 = true; } else if (this.strName == "PrintTo_Receipt") { flag21 = true; } else if (this.strName == "PrintTo_Journal") { flag22 = true; } else if (this.strName == "PrintTo_Quotation") { flag23 = true; } else if (this.strName == "PrintTo_ProformaInvoice") { flag24 = true; } else if (this.strName == "PrintTo_IBT") { flag25 = true; } else if (this.strName == "PrintTo_IBTreturn") { flag26 = true; } else if (this.strName == "PrintTo_CashPurchase") { flag27 = true; } else if (this.strName == "PrintTo_CashPurchaseReturn") { flag28 = true; } else if (this.strName == "PrintTo_AccPurchase") { flag29 = true; } else if (this.strName == "PrintTo_DebitNote") { flag30 = true; } else if (this.strName == "PrintTo_Payment") { flag31 = true; } else if (this.strName == "PrintTo_CreditorJournal") { flag32 = true; } else if (this.strName == "PrintTo_PurchaseOrder") { flag33 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.workstation_config ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerIP` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `LastUserName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `Drawer_Type` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `Drawer_Comport` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `Drawer_Kickercode1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Drawer_Kickercode2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Drawer_Kickercode3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Drawer_Kickercode4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Drawer_Kickercode5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Drawer_Kickercode6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Drawer_Kickercode7` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `Drawer_Kickercode8` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `Drawer_Slipprinter` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `PrintTo_CashInvoice` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `PrintTo_Refund` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `PrintTo_Payout` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `PrintTo_AccInvoice` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `PrintTo_CreditNote` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `PrintTo_Receipt` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `PrintTo_Journal` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `PrintTo_Quotation` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `PrintTo_ProformaInvoice` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `PrintTo_IBT` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `PrintTo_IBTreturn` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `PrintTo_CashPurchase` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `PrintTo_CashPurchaseReturn` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `PrintTo_AccPurchase` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `PrintTo_DebitNote` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `PrintTo_Payment` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `PrintTo_CreditorJournal` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `PrintTo_PurchaseOrder` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.workstation_state_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".workstation_state "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '1',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`ComputerIP` varchar(45) NOT NULL default '',"); this.newTable.Append("`LastUserName` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".workstation_state"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "ComputerName") { flag2 = true; } else if (this.strName == "ComputerIP") { flag3 = true; } else if (this.strName == "LastUserName") { flag4 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.workstation_state ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerIP` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `LastUserName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600010C RID: 268 RVA: 0x00015224 File Offset: 0x00013424 private void Update_Bookmarks() { if (!this.bookmarks_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".bookmarks "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`Invoice_RefNo` varchar(45) NOT NULL default '0',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep_User` varchar(45) NOT NULL default '',"); this.newTable.Append("`Client_SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Client_SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`TransType` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("`TransGroup` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".bookmarks"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "InvoiceDate") { flag3 = true; } else if (this.strName == "Invoice_RefNo") { flag4 = true; } else if (this.strName == "ComputerName") { flag5 = true; } else if (this.strName == "SalesRep_User") { flag6 = true; } else if (this.strName == "Client_SupplierID") { flag7 = true; } else if (this.strName == "Client_SupplierName") { flag8 = true; } else if (this.strName == "SlipNote") { flag9 = true; } else if (this.strName == "Custom1") { flag10 = true; } else if (this.strName == "Custom2") { flag11 = true; } else if (this.strName == "Custom3") { flag12 = true; } else if (this.strName == "Custom4") { flag13 = true; } else if (this.strName == "Custom5") { flag14 = true; } else if (this.strName == "Custom6") { flag15 = true; } else if (this.strName == "TotalCost") { flag16 = true; } else if (this.strName == "TotalExcl") { flag17 = true; } else if (this.strName == "TotalVAT") { flag18 = true; } else if (this.strName == "TotalIncl") { flag19 = true; } else if (this.strName == "TotalPaid") { flag20 = true; } else if (this.strName == "TransID") { flag21 = true; } else if (this.strName == "TransType") { flag22 = true; } else if (this.strName == "StatementNote") { flag23 = true; } else if (this.strName == "DeliveryAddress") { flag24 = true; } else if (this.strName == "TransGroup") { flag25 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.bookmarks ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `Invoice_RefNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SalesRep_User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `Client_SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Client_SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `TransType` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `TransGroup` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.bookmarks_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".bookmarks_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Client_SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`SalesRep_User` varchar(45) NOT NULL default '',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag26 = false; bool flag7 = false; bool flag27 = false; bool flag2 = false; bool flag3 = false; bool flag28 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; bool flag32 = false; bool flag16 = false; bool flag33 = false; bool flag18 = false; bool flag34 = false; bool flag17 = false; bool flag19 = false; bool flag6 = false; bool flag35 = false; bool flag36 = false; bool flag37 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".bookmarks_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag26 = true; } else if (this.strName == "Client_SupplierID") { flag7 = true; } else if (this.strName == "ProductID") { flag27 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "InvoiceDate") { flag3 = true; } else if (this.strName == "IsProduct") { flag28 = true; } else if (this.strName == "ProductCode") { flag29 = true; } else if (this.strName == "Description") { flag30 = true; } else if (this.strName == "Qty") { flag31 = true; } else if (this.strName == "QtyAvailable") { flag32 = true; } else if (this.strName == "TotalCost") { flag16 = true; } else if (this.strName == "TotalSellingExcl") { flag33 = true; } else if (this.strName == "TotalVAT") { flag18 = true; } else if (this.strName == "TotalSellingIncl") { flag34 = true; } else if (this.strName == "TotalExcl") { flag17 = true; } else if (this.strName == "TotalIncl") { flag19 = true; } else if (this.strName == "SalesRep_User") { flag6 = true; } else if (this.strName == "OrigUnitPrice") { flag35 = true; } else if (this.strName == "Discount") { flag36 = true; } else if (this.strName == "IsOnPromotion") { flag37 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.bookmarks_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `Client_SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `TotalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `TotalIncl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SalesRep_User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag35) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag37) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600010D RID: 269 RVA: 0x0001673C File Offset: 0x0001493C private void Update_IBTs() { if (!this.ibt_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".ibt "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelReceiptIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalReturnsIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelReturnIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; bool flag21 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".ibt"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalCost") { flag14 = true; } else if (this.strName == "TotalPaid") { flag15 = true; } else if (this.strName == "RelReceiptIDs") { flag16 = true; } else if (this.strName == "TotalReturnsIncl") { flag17 = true; } else if (this.strName == "RelReturnIDs") { flag18 = true; } else if (this.strName == "StatementNote") { flag19 = true; } else if (this.strName == "TransID") { flag20 = true; } else if (this.strName == "DeliveryAddress") { flag21 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.ibt ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `RelReceiptIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalReturnsIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `RelReturnIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.ibt_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".ibt_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`RelIBTreturnIDs` varchar(450) NOT NULL default '',"); this.newTable.Append("`RelIBTreturnQtys` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag22 = false; bool flag5 = false; bool flag23 = false; bool flag2 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag14 = false; bool flag29 = false; bool flag30 = false; bool flag4 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".ibt_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag22 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag23 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag24 = true; } else if (this.strName == "ProductCode") { flag25 = true; } else if (this.strName == "Description") { flag26 = true; } else if (this.strName == "Qty") { flag27 = true; } else if (this.strName == "QtyAvailable") { flag28 = true; } else if (this.strName == "TotalCost") { flag14 = true; } else if (this.strName == "RelIBTreturnIDs") { flag29 = true; } else if (this.strName == "RelIBTreturnQtys") { flag30 = true; } else if (this.strName == "SalesRep") { flag4 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.ibt_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `RelIBTreturnIDs` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `RelIBTreturnQtys` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.ibt_returns_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".ibt_returns "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedTransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag20 = false; bool flag31 = false; bool flag19 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".ibt_returns"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalCost") { flag14 = true; } else if (this.strName == "TransID") { flag20 = true; } else if (this.strName == "RelatedTransID") { flag31 = true; } else if (this.strName == "StatementNote") { flag19 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.ibt_returns ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `RelatedTransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.ibt_returns_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".ibt_returns_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Reason` varchar(450) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag22 = false; bool flag5 = false; bool flag23 = false; bool flag2 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag14 = false; bool flag32 = false; bool flag4 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".ibt_returns_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag22 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag23 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag24 = true; } else if (this.strName == "ProductCode") { flag25 = true; } else if (this.strName == "Description") { flag26 = true; } else if (this.strName == "Qty") { flag27 = true; } else if (this.strName == "QtyAvailable") { flag28 = true; } else if (this.strName == "TotalCost") { flag14 = true; } else if (this.strName == "Reason") { flag32 = true; } else if (this.strName == "SalesRep") { flag4 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.ibt_returns_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `Reason` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600010E RID: 270 RVA: 0x00018648 File Offset: 0x00016848 private void Update_AltSupplierCodes() { if (!this.alt_supplier_codes_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".alt_supplier_codes "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`MainItemID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`AltCode` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".alt_supplier_codes"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "MainItemID") { flag = true; } else if (this.strName == "CompanyID") { flag2 = true; } else if (this.strName == "AltCode") { flag3 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.linked_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `MainItemID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `AltCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600010F RID: 271 RVA: 0x00018894 File Offset: 0x00016A94 private void Update_Proforma_Invoices() { if (!this.proforma_invoices_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".proforma_invoices "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".proforma_invoices"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag14 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalIncl") { flag16 = true; } else if (this.strName == "TransID") { flag17 = true; } else if (this.strName == "DeliveryAddress") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.proforma_invoices ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.proforma_invoices_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".proforma_invoices_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag19 = false; bool flag5 = false; bool flag20 = false; bool flag2 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag15 = false; bool flag28 = false; bool flag4 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".proforma_invoices_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag19 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag20 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag21 = true; } else if (this.strName == "ProductCode") { flag22 = true; } else if (this.strName == "Description") { flag23 = true; } else if (this.strName == "Qty") { flag24 = true; } else if (this.strName == "QtyAvailable") { flag25 = true; } else if (this.strName == "TotalCost") { flag26 = true; } else if (this.strName == "TotalSellingExcl") { flag27 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalSellingIncl") { flag28 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag29 = true; } else if (this.strName == "Discount") { flag30 = true; } else if (this.strName == "IsOnPromotion") { flag31 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.proforma_invoices_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `TotalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000110 RID: 272 RVA: 0x00019990 File Offset: 0x00017B90 private void InitDatabaseUpdate() { string text = AppDomain.CurrentDomain.BaseDirectory + "LastVersion.xml"; if (File.Exists(text)) { string lastVersionFromXML = this.GetLastVersionFromXML(text); if (lastVersionFromXML != Application.ProductVersion) { this.UpdateTable(); } } else { this.UpdateTable(); } } // Token: 0x06000111 RID: 273 RVA: 0x000199F0 File Offset: 0x00017BF0 private void CreateNewDatabase() { this.UpdateTable(); } // Token: 0x06000112 RID: 274 RVA: 0x000199FC File Offset: 0x00017BFC private void UpdateTable() { try { this.SqlQuery = "SHOW TABLES FROM " + this.databaseName; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "companies") { this.companies_Found = true; } else if (this.strName == "users") { this.users_Found = true; } else if (this.strName == "programs_config") { this.programs_config_Found = true; } else if (this.strName == "workstation_config") { this.workstation_config_Found = true; } else if (this.strName == "workstation_state") { this.workstation_state_Found = true; } else if (this.strName == "products") { this.products_Found = true; } else if (this.strName == "item_maintenance") { this.item_maintenance_Found = true; } else if (this.strName == "label_generator_config") { this.label_generator_config_Found = true; } else if (this.strName == "label_generator_batch") { this.label_generator_batch_Found = true; } else if (this.strName == "linked_items") { this.linked_items_Found = true; } else if (this.strName == "alt_supplier_codes") { this.alt_supplier_codes_Found = true; } else if (this.strName == "convert_items") { this.convert_items_Found = true; } else if (this.strName == "clients") { this.clients_Found = true; } else if (this.strName == "cash_sales") { this.cash_sales_Found = true; } else if (this.strName == "cash_sales_items") { this.cash_sales_items_Found = true; } else if (this.strName == "cash_refunds") { this.cash_refunds_Found = true; } else if (this.strName == "cash_refunds_items") { this.cash_refunds_items_Found = true; } else if (this.strName == "payouts") { this.payouts_Found = true; } else if (this.strName == "receipts") { this.receipts_Found = true; } else if (this.strName == "credit_sales") { this.credit_sales_Found = true; } else if (this.strName == "credit_sales_items") { this.credit_sales_items_Found = true; } else if (this.strName == "credit_notes") { this.credit_notes_Found = true; } else if (this.strName == "credit_notes_items") { this.credit_notes_items_Found = true; } else if (this.strName == "debtor_journals") { this.debtor_journals_Found = true; } else if (this.strName == "quotations") { this.quotations_Found = true; } else if (this.strName == "quotations_items") { this.quotations_items_Found = true; } else if (this.strName == "proforma_invoices") { this.proforma_invoices_Found = true; } else if (this.strName == "proforma_invoices_items") { this.proforma_invoices_items_Found = true; } else if (this.strName == "ibt") { this.ibt_Found = true; } else if (this.strName == "ibt_items") { this.ibt_items_Found = true; } else if (this.strName == "ibt_returns") { this.ibt_returns_Found = true; } else if (this.strName == "ibt_returns_items") { this.ibt_returns_items_Found = true; } else if (this.strName == "suppliers") { this.suppliers_Found = true; } else if (this.strName == "cash_purchases") { this.cash_purchases_Found = true; } else if (this.strName == "cash_purchases_items") { this.cash_purchases_items_Found = true; } else if (this.strName == "cash_purchases_returns") { this.cash_purchases_returns_Found = true; } else if (this.strName == "cash_purchases_returns_items") { this.cash_purchases_returns_items_Found = true; } else if (this.strName == "payments") { this.payments_Found = true; } else if (this.strName == "credit_purchases") { this.credit_purchases_Found = true; } else if (this.strName == "credit_purchases_items") { this.credit_purchases_items_Found = true; } else if (this.strName == "debit_notes") { this.debit_notes_Found = true; } else if (this.strName == "debit_notes_items") { this.debit_notes_items_Found = true; } else if (this.strName == "creditor_journals") { this.creditor_journals_Found = true; } else if (this.strName == "purchase_orders") { this.purchase_orders_Found = true; } else if (this.strName == "purchase_orders_items") { this.purchase_orders_items_Found = true; } else if (this.strName == "emails_sent_history") { this.emails_sent_history_Found = true; } else if (this.strName == "bookmarks") { this.bookmarks_Found = true; } else if (this.strName == "bookmarks_items") { this.bookmarks_items_Found = true; } } } this.drMySql.Close(); this.Update_Companies(); this.Update_Users(); this.Update_Programs_Config(); this.Update_WorkstationConfig(); this.Update_Clients(); this.Update_Products(); this.Update_Invoices(); this.Update_Quotations(); this.Update_IBTs(); this.Update_Proforma_Invoices(); this.Update_PettyCash(); this.Update_Suppliers(); this.Update_Purchases(); this.Update_PurchaseOrders(); this.Update_LabelGenerator(); if (!this.emails_sent_history_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".emails_sent_history "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`TransType` varchar(45) NOT NULL default '',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`Failed` tinyint(3) NOT NULL default 0,"); this.newTable.Append("`FailedReason` text NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`Recipient` varchar(145) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".emails_sent_history"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "TransID") { flag2 = true; } else if (this.strName == "TransType") { flag3 = true; } else if (this.strName == "Date") { flag4 = true; } else if (this.strName == "Failed") { flag5 = true; } else if (this.strName == "FailedReason") { flag6 = true; } else if (this.strName == "User") { flag7 = true; } else if (this.strName == "Recipient") { flag8 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.emails_sent_history ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `TransType` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `Failed` tinyint(3) NOT NULL default 0;\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `FailedReason` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Recipient` varchar(145) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } this.Update_Item_Maintenance(); this.Update_LinkedItems(); this.Update_AltSupplierCodes(); this.Update_ConvertItems(); this.Update_Bookmarks(); if (this.sbFinal.ToString().Length > 0) { this.cmmMySql.CommandTimeout = 300; this.cmmMySql.CommandText = this.sbFinal.ToString(); this.cmmMySql.ExecuteNonQuery(); } } catch (Exception ex) { this.ShowMessage("Failed to update the database", ex.Message, "&OK", string.Empty, true, false, false, frm.MessageColor.Red); } finally { this.cmmMySql.CommandText = string.Empty; this.sbFinal.Clear(); string fileName = AppDomain.CurrentDomain.BaseDirectory + "LastVersion.xml"; this.WriteLastVersionToXML(fileName); } } // Token: 0x06000113 RID: 275 RVA: 0x0001A7B4 File Offset: 0x000189B4 private string GetLastVersionFromXML(string fileName) { string result = string.Empty; using (XmlTextReader xmlTextReader = new XmlTextReader(fileName)) { while (xmlTextReader.Read()) { if (xmlTextReader.NodeType == XmlNodeType.Element && xmlTextReader.Name == "last_version") { result = xmlTextReader.ReadString(); } } xmlTextReader.Close(); } return result; } // Token: 0x06000114 RID: 276 RVA: 0x0001A83C File Offset: 0x00018A3C private void WriteLastVersionToXML(string fileName) { this.Cursor = Cursors.WaitCursor; using (XmlTextWriter xmlTextWriter = new XmlTextWriter(fileName, null)) { xmlTextWriter.Formatting = Formatting.Indented; xmlTextWriter.WriteStartDocument(); xmlTextWriter.WriteStartElement("LastVersion"); xmlTextWriter.WriteElementString("last_version", Application.ProductVersion); xmlTextWriter.WriteEndElement(); xmlTextWriter.WriteEndDocument(); xmlTextWriter.Flush(); xmlTextWriter.Close(); } this.Cursor = Cursors.Default; } // Token: 0x06000115 RID: 277 RVA: 0x0001A8D8 File Offset: 0x00018AD8 private void SkinControl(Control control) { if (control.GetType() == typeof(TabPage)) { control.BackColor = this.schemeBackColor; } foreach (object obj in control.Controls) { Control control2 = (Control)obj; if (control2.GetType() == typeof(Button)) { control2.BackColor = this.schemeBackColor; ((Button)control2).FlatAppearance.MouseOverBackColor = this.schemeMouseOver; ((Button)control2).FlatAppearance.MouseDownBackColor = this.schemeMouseDown; } else if (control2.GetType() == typeof(ListView)) { control2.BackColor = this.StyleColorPlusX(5, this.schemeBackColor); } else if (control2.GetType() == typeof(CheckedListBox)) { control2.BackColor = this.StyleColorPlusX(5, this.schemeBackColor); } else if (control2.GetType() == typeof(RadioButton)) { control2.BackColor = this.schemeBackColor; ((RadioButton)control2).FlatAppearance.MouseOverBackColor = this.schemeMouseOver; ((RadioButton)control2).FlatAppearance.MouseDownBackColor = this.schemeMouseDown; ((RadioButton)control2).FlatAppearance.CheckedBackColor = this.schemeCheckedColor; } else if (control2.GetType() == typeof(CheckBox)) { control2.BackColor = this.schemeBackColor; ((CheckBox)control2).FlatAppearance.MouseOverBackColor = this.schemeMouseOver; ((CheckBox)control2).FlatAppearance.MouseDownBackColor = this.schemeMouseDown; ((CheckBox)control2).FlatAppearance.CheckedBackColor = this.schemeCheckedColor; } else { this.SkinControl(control2); } } } // Token: 0x06000116 RID: 278 RVA: 0x0001AB34 File Offset: 0x00018D34 private Color StyleColorPlusX(int x, Color color) { int num = (int)color.R; int num2 = (int)color.G; int num3 = (int)color.B; if (num + x <= 255) { num += x; } if (num2 + x <= 255) { num2 += x; } if (num3 + x <= 255) { num3 += x; } return Color.FromArgb(num, num2, num3); } // Token: 0x06000117 RID: 279 RVA: 0x0001ABA8 File Offset: 0x00018DA8 private Color StyleColorMinusX(int x, Color color) { int num = (int)color.R; int num2 = (int)color.G; int num3 = (int)color.B; if (num - x >= 0) { num -= x; } if (num2 - x >= 0) { num2 -= x; } if (num3 - x >= 0) { num3 -= x; } return Color.FromArgb(num, num2, num3); } // Token: 0x06000118 RID: 280 RVA: 0x0001AC10 File Offset: 0x00018E10 private void SetScheme_Default(Control control) { this.SchemeColor = frm.schemeName.Default; this.BackColor = Color.FromArgb(75, 75, 75); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(97, 97, 97); this.schemeMouseDown = Color.Gray; this.schemeCheckedColor = Color.Gray; this.schemeButtonColor = this.StyleColorPlusX(12, this.schemeBackColor); this.SkinControl(control); } // Token: 0x06000119 RID: 281 RVA: 0x0001AC88 File Offset: 0x00018E88 private void SetScheme_Brown(Control control) { this.SchemeColor = frm.schemeName.Brown; this.BackColor = Color.FromArgb(140, 97, 59); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(160, 117, 79); this.schemeMouseDown = Color.FromArgb(120, 77, 39); this.schemeCheckedColor = Color.FromArgb(115, 78, 64); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x0600011A RID: 282 RVA: 0x0001AD10 File Offset: 0x00018F10 private void SetScheme_Blue(Control control) { this.SchemeColor = frm.schemeName.Blue; this.BackColor = Color.FromArgb(0, 88, 95); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(20, 108, 115); this.schemeMouseDown = Color.FromArgb(23, 174, 191); this.schemeCheckedColor = Color.FromArgb(255, 56, 0); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x0600011B RID: 283 RVA: 0x0001AD9C File Offset: 0x00018F9C private void SetScheme_Green(Control control) { this.SchemeColor = frm.schemeName.Green; this.BackColor = Color.FromArgb(44, 94, 46); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(64, 114, 66); this.schemeMouseDown = Color.FromArgb(102, 174, 83); this.schemeCheckedColor = Color.FromArgb(84, 189, 227); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x0600011C RID: 284 RVA: 0x0001AE28 File Offset: 0x00019028 private void SetScheme_Red(Control control) { this.SchemeColor = frm.schemeName.Red; this.BackColor = Color.FromArgb(96, 0, 0); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(116, 20, 20); this.schemeMouseDown = Color.FromArgb(172, 17, 17); this.schemeCheckedColor = Color.FromArgb(9, 109, 172); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x0600011D RID: 285 RVA: 0x0001AEB0 File Offset: 0x000190B0 private void SetScheme_Pink(Control control) { this.SchemeColor = frm.schemeName.Pink; this.BackColor = Color.FromArgb(178, 24, 65); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(198, 44, 85); this.schemeMouseDown = Color.FromArgb(200, 50, 40); this.schemeCheckedColor = Color.FromArgb(99, 166, 159); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x0600011E RID: 286 RVA: 0x0001AF44 File Offset: 0x00019144 private void SetScheme_Bonsai(Control control) { this.SchemeColor = frm.schemeName.Bonsai; this.BackColor = Color.FromArgb(127, 119, 52); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(147, 139, 72); this.schemeMouseDown = Color.FromArgb(165, 155, 75); this.schemeCheckedColor = Color.FromArgb(63, 82, 43); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x0600011F RID: 287 RVA: 0x0001AFD4 File Offset: 0x000191D4 private void SetScheme_Black(Control control) { this.SchemeColor = frm.schemeName.Black; this.BackColor = Color.FromArgb(0, 0, 0); this.schemeBackColor = this.BackColor; this.schemeMouseOver = Color.FromArgb(20, 20, 20); this.schemeMouseDown = Color.FromArgb(10, 10, 10); this.schemeCheckedColor = Color.FromArgb(236, 160, 16); this.schemeButtonColor = this.StyleColorPlusX(10, this.schemeBackColor); this.SkinControl(control); } // Token: 0x06000120 RID: 288 RVA: 0x0001B05C File Offset: 0x0001925C private void SkinOtherControls() { this.btnClearLogo.BackColor = this.schemeButtonColor; this.btnClearStyle.BackColor = this.schemeButtonColor; this.btnAddLogo.BackColor = this.schemeButtonColor; this.btnAddStyle.BackColor = this.schemeButtonColor; this.btnDrawerTest.BackColor = this.schemeButtonColor; this.btnConfDrawerReset.BackColor = this.schemeButtonColor; this.btnUserPicChange.BackColor = this.schemeButtonColor; this.btnProgramOptions.BackColor = this.schemeButtonColor; this.btnRenewLicence.BackColor = this.schemeButtonColor; this.btnBackup.BackColor = this.schemeButtonColor; this.btnRestore.BackColor = this.schemeButtonColor; this.btnBackupAdvanced.BackColor = this.schemeButtonColor; } // Token: 0x06000121 RID: 289 RVA: 0x0001B144 File Offset: 0x00019344 private void LoadScheme(string scheme) { this.lastLoadedScheme = scheme; if (string.Compare(scheme, "default", true) == 0) { this.SetScheme_Default(this); } else if (string.Compare(scheme, "blue", true) == 0) { this.SetScheme_Blue(this); } else if (string.Compare(scheme, "brown", true) == 0) { this.SetScheme_Brown(this); } else if (string.Compare(scheme, "green", true) == 0) { this.SetScheme_Green(this); } else if (string.Compare(scheme, "red", true) == 0) { this.SetScheme_Red(this); } else if (string.Compare(scheme, "pink", true) == 0) { this.SetScheme_Pink(this); } else if (string.Compare(scheme, "bonsai", true) == 0) { this.SetScheme_Bonsai(this); } else if (string.Compare(scheme, "black", true) == 0) { this.SetScheme_Black(this); } this.SkinOtherControls(); } // Token: 0x06000122 RID: 290 RVA: 0x0001B27C File Offset: 0x0001947C private void Update_Clients() { if (!this.clients_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".clients "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Name` varchar(245) NOT NULL default '',"); this.newTable.Append("`Email` varchar(450) NOT NULL default '',"); this.newTable.Append("`BillingAddress` text NOT NULL default '',"); this.newTable.Append("`ContactNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`LastCashTransDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastCashInvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastCashRefundDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastAccountTransDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastAccountInvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastCreditNoteDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastReceiptDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastJournalDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`TotalDue` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`PriceOverrideRule` varchar(45) NOT NULL default '',"); this.newTable.Append("`PriceOverrideValue` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Note` text NOT NULL default '',"); this.newTable.Append("`InterestOver` varchar(45) NOT NULL default 'No Interest',"); this.newTable.Append("`InterestValue` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Area` varchar(45) NOT NULL default '',"); this.newTable.Append("`City` varchar(45) NOT NULL default '',"); this.newTable.Append("`CreditLimit` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Status` varchar(45) NOT NULL default 'Active',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".clients"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "Name") { flag2 = true; } else if (this.strName == "ClientID") { flag = true; } else if (this.strName == "Email") { flag3 = true; } else if (this.strName == "BillingAddress") { flag4 = true; } else if (this.strName == "ContactNo") { flag5 = true; } else if (this.strName == "CompanyID") { flag6 = true; } else if (this.strName == "LastCashTransDate") { flag7 = true; } else if (this.strName == "LastCashInvoiceDate") { flag8 = true; } else if (this.strName == "LastCashRefundDate") { flag9 = true; } else if (this.strName == "LastAccountTransDate") { flag10 = true; } else if (this.strName == "LastAccountInvoiceDate") { flag11 = true; } else if (this.strName == "LastCreditNoteDate") { flag12 = true; } else if (this.strName == "LastReceiptDate") { flag13 = true; } else if (this.strName == "LastJournalDate") { flag14 = true; } else if (this.strName == "TotalDue") { flag15 = true; } else if (this.strName == "PriceOverrideRule") { flag16 = true; } else if (this.strName == "PriceOverrideValue") { flag17 = true; } else if (this.strName == "Note") { flag18 = true; } else if (this.strName == "InterestOver") { flag19 = true; } else if (this.strName == "InterestValue") { flag20 = true; } else if (this.strName == "Area") { flag21 = true; } else if (this.strName == "City") { flag22 = true; } else if (this.strName == "CreditLimit") { flag23 = true; } else if (this.strName == "Status") { flag24 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.clients ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Name` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `Email` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `BillingAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ContactNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `LastCashTransDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `LastCashInvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `LastCashRefundDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `LastAccountTransDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `LastAccountInvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `LastCreditNoteDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `LastReceiptDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `LastJournalDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalDue` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `PriceOverrideRule` varchar(45) NOT NULL default 'Use normal selling prices';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `PriceOverrideValue` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `Note` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `InterestOver` varchar(45) NOT NULL default 'No Interest';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `InterestValue` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `Area` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `City` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `CreditLimit` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Status` varchar(45) NOT NULL default 'Active';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000123 RID: 291 RVA: 0x0001BD78 File Offset: 0x00019F78 private void Update_Companies() { if (!this.companies_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".companies "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`Name` varchar(60) NOT NULL default '',"); this.newTable.Append("`Email` varchar(245) NOT NULL default '',"); this.newTable.Append("`Address` text NOT NULL,"); this.newTable.Append("`RegNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`VATno` varchar(45) NOT NULL default '',"); this.newTable.Append("`VATrate` varchar(5) NOT NULL default '',"); this.newTable.Append("`ContactNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`AltNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`FaxNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`CellNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`LogoPath` varchar(245) NOT NULL default '',"); this.newTable.Append("`InvoiceStylePath` varchar(245) NOT NULL default '',"); this.newTable.Append("`InvoiceSize` varchar(45) NOT NULL default '',"); this.newTable.Append("`BankingDetails` text NOT NULL,"); this.newTable.Append("`FinYearStartMonth` varchar(45) NOT NULL default '',"); this.newTable.Append("`Scheme` varchar(45) NOT NULL default '',"); this.newTable.Append("`Status` varchar(45) NOT NULL default 'Active',"); this.newTable.Append("`IsMultiUser` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".companies"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "Name") { flag = true; } else if (this.strName == "Email") { flag2 = true; } else if (this.strName == "Address") { flag3 = true; } else if (this.strName == "RegNo") { flag4 = true; } else if (this.strName == "VATno") { flag5 = true; } else if (this.strName == "VATrate") { flag6 = true; } else if (this.strName == "ContactNo") { flag7 = true; } else if (this.strName == "AltNo") { flag8 = true; } else if (this.strName == "FaxNo") { flag9 = true; } else if (this.strName == "CellNo") { flag10 = true; } else if (this.strName == "LogoPath") { flag11 = true; } else if (this.strName == "InvoiceStylePath") { flag12 = true; } else if (this.strName == "InvoiceSize") { flag13 = true; } else if (this.strName == "BankingDetails") { flag14 = true; } else if (this.strName == "FinYearStartMonth") { flag15 = true; } else if (this.strName == "Scheme") { flag16 = true; } else if (this.strName == "Status") { flag17 = true; } else if (this.strName == "IsMultiUser") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.companies ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `Name` varchar(60) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Email` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `Address` text NOT NULL;\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `RegNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `VATno` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `VATrate` varchar(5) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `ContactNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `AltNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `FaxNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `CellNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `LogoPath` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `InvoiceStylePath` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `InvoiceSize` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `BankingDetails` text NOT NULL;\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `FinYearStartMonth` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `Scheme` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `Status` varchar(45) NOT NULL default 'Active';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `IsMultiUser` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000124 RID: 292 RVA: 0x0001C5FC File Offset: 0x0001A7FC private void Update_Item_Maintenance() { if (!this.item_maintenance_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".item_maintenance "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`CostPrice` decimal(14,2) NOT NULL default '0.0000',"); this.newTable.Append("`SellingPrice` decimal(14,2) NOT NULL default '0.0000',"); this.newTable.Append("`SellingPriceIncl` decimal(14,2) NOT NULL default '0.0000',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyFound` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Reason` varchar(45) NOT NULL default '',"); this.newTable.Append("`Note` text NOT NULL default '',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".item_maintenance "; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "ProductCode") { flag = true; } else if (this.strName == "Description") { flag2 = true; } else if (this.strName == "CostPrice") { flag3 = true; } else if (this.strName == "SellingPrice") { flag4 = true; } else if (this.strName == "SellingPriceIncl") { flag5 = true; } else if (this.strName == "QtyAvailable") { flag6 = true; } else if (this.strName == "QtyFound") { flag7 = true; } else if (this.strName == "IsProduct") { flag8 = true; } else if (this.strName == "CompanyID") { flag9 = true; } else if (this.strName == "ProductID") { flag10 = true; } else if (this.strName == "Reason") { flag11 = true; } else if (this.strName == "Note") { flag12 = true; } else if (this.strName == "Date") { flag13 = true; } else if (this.strName == "User") { flag14 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.item_maintenance ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `CostPrice` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SellingPrice` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SellingPriceIncl` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `QtyFound` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Reason` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Note` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000125 RID: 293 RVA: 0x0001CCDC File Offset: 0x0001AEDC private void Update_LabelGenerator() { if (!this.label_generator_config_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".label_generator_config "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`PrintTo` varchar(145) NOT NULL default '',"); this.newTable.Append("`UseThisLabel` varchar(45) NOT NULL default '',"); this.newTable.Append("`PrintSellingPrice` varchar(45) NOT NULL default '',"); this.newTable.Append("`PrintCustom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`PrintCustom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`PrintCustom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`AfterAddingItemToGridDo` varchar(45) NOT NULL default 'Goto a new line',"); this.newTable.Append("`OrderBy` varchar(45) NOT NULL default '',"); this.newTable.Append("`ShowRetailPrice` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".label_generator_config"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "PrintTo") { flag = true; } else if (this.strName == "UseThisLabel") { flag2 = true; } else if (this.strName == "PrintSellingPrice") { flag3 = true; } else if (this.strName == "PrintCustom1") { flag4 = true; } else if (this.strName == "PrintCustom2") { flag5 = true; } else if (this.strName == "PrintCustom3") { flag6 = true; } else if (this.strName == "OrderBy") { flag7 = true; } else if (this.strName == "ShowRetailPrice") { flag8 = true; } else if (this.strName == "Custom1") { flag9 = true; } else if (this.strName == "Custom2") { flag10 = true; } else if (this.strName == "Custom3") { flag11 = true; } else if (this.strName == "CompanyID") { flag12 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.label_generator_config ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `PrintTo` varchar(145) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `UseThisLabel` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `PrintSellingPrice` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `PrintCustom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `PrintCustom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `PrintCustom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `OrderBy` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `ShowRetailPrice` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.label_generator_batch_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".label_generator_batch "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`AltProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(245) NOT NULL default '',"); this.newTable.Append("`RetailPrice` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".label_generator_batch"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "ProductCode") { flag13 = true; } else if (this.strName == "AltProductCode") { flag14 = true; } else if (this.strName == "Description") { flag15 = true; } else if (this.strName == "RetailPrice") { flag16 = true; } else if (this.strName == "Custom1") { flag9 = true; } else if (this.strName == "Custom2") { flag10 = true; } else if (this.strName == "Custom3") { flag11 = true; } else if (this.strName == "CompanyID") { flag12 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.label_generator_batch ADD COLUMN", this.databaseName); if (!flag13) { this.column = string.Format("{0} `ProductCode`varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `AltProductCode`varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `Description`varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); } if (!flag16) { this.column = string.Format("{0} `RetailPrice` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000126 RID: 294 RVA: 0x0001D750 File Offset: 0x0001B950 private void Update_LinkedItems() { if (!this.linked_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".linked_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`MainItemID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`LinkedItemID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`QtyToLink` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".linked_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "MainItemID") { flag = true; } else if (this.strName == "LinkedItemID") { flag2 = true; } else if (this.strName == "QtyToLink") { flag3 = true; } else if (this.strName == "CompanyID") { flag4 = true; } else if (this.strName == "Description") { flag5 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.linked_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `MainItemID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `LinkedItemID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `QtyToLink` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000127 RID: 295 RVA: 0x0001DA80 File Offset: 0x0001BC80 private void Update_ConvertItems() { if (!this.convert_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".convert_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`MainItemID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ConvertItemID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`QtyToConvert` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".convert_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "MainItemID") { flag = true; } else if (this.strName == "ConvertItemID") { flag2 = true; } else if (this.strName == "QtyToConvert") { flag3 = true; } else if (this.strName == "CompanyID") { flag4 = true; } else if (this.strName == "Description") { flag5 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.convert_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `MainItemID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `ConvertItemID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `QtyToConvert` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000128 RID: 296 RVA: 0x0001DDAE File Offset: 0x0001BFAE private void Update_PettyCash() { } // Token: 0x06000129 RID: 297 RVA: 0x0001DDB4 File Offset: 0x0001BFB4 private void Update_Products() { if (!this.products_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".products "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`CostPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`SellingPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`VatRate` decimal(4,2) NOT NULL default '0.00',"); this.newTable.Append("`SellingPriceIncl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`HideFromSales` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`HideFromPurchases` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`IsNegativeItem` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Category` varchar(45) NOT NULL default '',"); this.newTable.Append("`SubCategory` varchar(45) NOT NULL default '',"); this.newTable.Append("`Location` varchar(45) NOT NULL default '',"); this.newTable.Append("`SubLocation` varchar(45) NOT NULL default '',"); this.newTable.Append("`MinQty` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`MaxQty` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`CaseQty` decimal(14,4) NOT NULL default '1.0000',"); this.newTable.Append("`PromotionFromDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`PromotionToDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`PromotionPriceIncl` decimal(14,2) NOT NULL default '0.0000',"); this.newTable.Append("`MainSupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`MaxDiscount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`PictureName` varchar(45) NOT NULL default '',"); this.newTable.Append("`Note` varchar(500) NOT NULL default '',"); this.newTable.Append("`DateCreated` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`QtyCounted` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyBackup` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Status` varchar(45) NOT NULL default 'Active',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".products"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "ProductCode") { flag = true; } else if (this.strName == "Description") { flag2 = true; } else if (this.strName == "CostPrice") { flag3 = true; } else if (this.strName == "SellingPrice") { flag4 = true; } else if (this.strName == "VatRate") { flag5 = true; } else if (this.strName == "SellingPriceIncl") { flag6 = true; } else if (this.strName == "QtyAvailable") { flag7 = true; } else if (this.strName == "IsProduct") { flag8 = true; } else if (this.strName == "IsNegativeItem") { flag9 = true; } else if (this.strName == "HideFromSales") { flag10 = true; } else if (this.strName == "HideFromPurchases") { flag11 = true; } else if (this.strName == "CompanyID") { flag12 = true; } else if (this.strName == "ProductID") { flag13 = true; } else if (this.strName == "Category") { flag14 = true; } else if (this.strName == "SubCategory") { flag15 = true; } else if (this.strName == "Location") { flag16 = true; } else if (this.strName == "SubLocation") { flag17 = true; } else if (this.strName == "MinQty") { flag18 = true; } else if (this.strName == "MaxQty") { flag19 = true; } else if (this.strName == "CaseQty") { flag20 = true; } else if (this.strName == "PromotionFromDate") { flag21 = true; } else if (this.strName == "PromotionToDate") { flag22 = true; } else if (this.strName == "PromotionPriceIncl") { flag23 = true; } else if (this.strName == "MainSupplierID") { flag24 = true; } else if (this.strName == "MaxDiscount") { flag25 = true; } else if (this.strName == "PictureName") { flag26 = true; } else if (this.strName == "Note") { flag27 = true; } else if (this.strName == "DateCreated") { flag28 = true; } else if (this.strName == "QtyCounted") { flag29 = true; } else if (this.strName == "QtyBackup") { flag30 = true; } else if (this.strName == "Status") { flag31 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.products ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `CostPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SellingPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `VatRate` decimal(4,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SellingPriceIncl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `IsNegativeItem` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `HideFromSales` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `HideFromPurchases` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `Category` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `SubCategory` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `Location` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `SubLocation` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `MinQty` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `MaxQty` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `CaseQty` decimal(14,4) NOT NULL default '1.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `PromotionFromDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `PromotionToDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `PromotionPriceIncl` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `MainSupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `MaxDiscount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `PictureName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `Note` varchar(500) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `DateCreated` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `QtyCounted` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `QtyBackup` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `Status` varchar(45) NOT NULL default 'Active';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600012A RID: 298 RVA: 0x0001EB8C File Offset: 0x0001CD8C private void Update_Programs_Config() { if (!this.programs_config_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".programs_config "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`SellingUnderCostOption` varchar(45) NOT NULL default 'warn',"); this.newTable.Append("`SellingOverQtyOption` varchar(45) NOT NULL default 'warn',"); this.newTable.Append("`InvShowRetailPriceExcl` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`DefaultInvoiceType` varchar(45) NOT NULL default 'Choose',"); this.newTable.Append("`DefaultPurchaseType` varchar(45) NOT NULL default 'Choose',"); this.newTable.Append("`ShowAmountDueOnSalesDocs` tinyint(3) unsigned NOT NULL default '1',"); this.newTable.Append("`DefaultItemType` varchar(45) NOT NULL default 'Choose',"); this.newTable.Append("`StockTakeMethod` varchar(45) NOT NULL default 'WallToWall',"); this.newTable.Append("`StockTake_ShowQtyAvailable` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`StockTake_LoadRecords` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`StockTake_AfterSavingSheet` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`StockTake_AfterSavingSheet_PrintTo` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`StockTake_VarianceOrderBy` varchar(45) NOT NULL default 'Order variances by Description',"); this.newTable.Append("`StockTake_VarianceShow` varchar(45) NOT NULL default 'Show variances only',"); this.newTable.Append("`LinkedItemsOptions` varchar(45) NOT NULL default 'Hide linked items',"); this.newTable.Append("`AfterAddingItemToGridDo` varchar(45) NOT NULL default 'Goto a new line',"); this.newTable.Append("`AfterAddingItemToGridDo_Purchases` varchar(45) NOT NULL default 'Goto a new line',"); this.newTable.Append("`PaymentMethods` text NOT NULL default '',"); this.newTable.Append("`InvSlipNote` text NOT NULL default '',"); this.newTable.Append("`QuotationSlipNote` text NOT NULL default '',"); this.newTable.Append("`PriceOverridePassword` varchar(45) NOT NULL default '',"); this.newTable.Append("`PriceEmbeddedPrefix` varchar(45) NOT NULL default '',"); this.newTable.Append("`PrintTo_CashInvoice` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Refund` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Payout` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_AccInvoice` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CreditNote` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Receipt` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Journal` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Quotation` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_ProformaInvoice` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_IBT` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_IBTreturn` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CashPurchase` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CashPurchaseReturn` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_AccPurchase` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_DebitNote` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_Payment` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_CreditorJournal` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`PrintTo_PurchaseOrder` varchar(245) NOT NULL default 'Use default printer',"); this.newTable.Append("`Copies_CashInvoice` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_Refund` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_Payout` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_AccInvoice` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_CreditNote` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_Receipt` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_Journal` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_Quotation` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_ProformaInvoice` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_IBT` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_IBTreturn` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_CashPurchase` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_CashPurchaseReturn` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_AccPurchase` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_DebitNote` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_Payment` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_CreditorJournal` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`Copies_PurchaseOrder` int(10) UNSIGNED NOT NULL default '1',"); this.newTable.Append("`SlipSize_CashInvoice` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_Refund` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_Payout` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_AccInvoice` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_CreditNote` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_Receipt` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_Journal` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_Quotation` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_ProformaInvoice` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_IBT` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_IBTreturn` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_CashPurchase` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_CashPurchaseReturn` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_AccPurchase` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_DebitNote` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_Payment` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_CreditorJournal` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`SlipSize_PurchaseOrder` varchar(45) NOT NULL default 'A4',"); this.newTable.Append("`AfterTransDo1_CashInvoice` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_Refund` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_Payout` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_AccInvoice` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_CreditNote` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_Receipt` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_Journal` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_Quotation` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_ProformaInvoice` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_IBT` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_IBTreturn` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_CashPurchase` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_CashPurchaseReturn` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_AccPurchase` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_DebitNote` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_Payment` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_CreditorJournal` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo1_PurchaseOrder` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_CashInvoice` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_Refund` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_Payout` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_AccInvoice` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_CreditNote` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_Receipt` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_Journal` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_Quotation` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_ProformaInvoice` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_IBT` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_IBTreturn` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_CashPurchase` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_CashPurchaseReturn` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_AccPurchase` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_DebitNote` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_Payment` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_CreditorJournal` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`AfterTransDo2_PurchaseOrder` varchar(45) NOT NULL default 'Do nothing',"); this.newTable.Append("`InvCustomLabel1` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvCustomLabel2` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvCustomLabel3` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvCustomLabel4` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvCustomLabel5` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvCustomLabel6` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvCustomValue1` varchar(450) NOT NULL default '',"); this.newTable.Append("`InvCustomValue2` varchar(450) NOT NULL default '',"); this.newTable.Append("`InvCustomValue3` varchar(450) NOT NULL default '',"); this.newTable.Append("`InvCustomValue4` varchar(450) NOT NULL default '',"); this.newTable.Append("`InvCustomValue5` varchar(450) NOT NULL default '',"); this.newTable.Append("`InvCustomValue6` varchar(450) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomLabel1` varchar(45) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomLabel2` varchar(45) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomLabel3` varchar(45) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomLabel4` varchar(45) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomLabel5` varchar(45) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomLabel6` varchar(45) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomValue1` varchar(450) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomValue2` varchar(450) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomValue3` varchar(450) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomValue4` varchar(450) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomValue5` varchar(450) NOT NULL default '',"); this.newTable.Append("`PurchaseCustomValue6` varchar(450) NOT NULL default '',"); this.newTable.Append("`EmailAccount` varchar(45) NOT NULL default '',"); this.newTable.Append("`EmailAddress` varchar(245) NOT NULL default '',"); this.newTable.Append("`EmailUserName` varchar(245) NOT NULL default '',"); this.newTable.Append("`EmailPassword` varchar(45) NOT NULL default '',"); this.newTable.Append("`EmailSMTPAddress` varchar(245) NOT NULL default '',"); this.newTable.Append("`EmailSMTPPort` varchar(45) NOT NULL default '',"); this.newTable.Append("`PayOutReasons` text NOT NULL default '',"); this.newTable.Append("`CashDrawerType` varchar(45) NOT NULL default 'None',"); this.newTable.Append("`CashDrawerComPort` int(10) NOT NULL default '1',"); this.newTable.Append("`CashDrawerKickerCode1` int(10) unsigned NOT NULL default '27',"); this.newTable.Append("`CashDrawerKickerCode2` int(10) unsigned NOT NULL default '112',"); this.newTable.Append("`CashDrawerKickerCode3` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`CashDrawerKickerCode4` int(10) unsigned NOT NULL default '100',"); this.newTable.Append("`CashDrawerKickerCode5` int(10) unsigned NOT NULL default '100',"); this.newTable.Append("`CashDrawerKickerCode6` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`CashDrawerKickerCode7` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`CashDrawerKickerCode8` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`CashDrawerSlipPrinter` varchar(45) NOT NULL default '',"); this.newTable.Append("`QtyDecimalValue` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`IsPortableDatabase` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`AllowSalesDiscount` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ShowDiscountOnSalesDocument` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`AllowPurchaseDiscount` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ShowDiscountOnPurchaseDocument` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`RoundToValue` int(10) NOT NULL default '0',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`QuotationDefaultName` varchar(45) NOT NULL default 'Quotation',"); this.newTable.Append("`ProformaDefaultName` varchar(45) NOT NULL default 'Proforma Invoice',"); this.newTable.Append("`ShowSalesSidePanelPicture` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ShowSalesSidePanelNote` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ShowSalesSidePanelItemDetails` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ShowSalesSidePanelAltItems` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; bool flag32 = false; bool flag33 = false; bool flag34 = false; bool flag35 = false; bool flag36 = false; bool flag37 = false; bool flag38 = false; bool flag39 = false; bool flag40 = false; bool flag41 = false; bool flag42 = false; bool flag43 = false; bool flag44 = false; bool flag45 = false; bool flag46 = false; bool flag47 = false; bool flag48 = false; bool flag49 = false; bool flag50 = false; bool flag51 = false; bool flag52 = false; bool flag53 = false; bool flag54 = false; bool flag55 = false; bool flag56 = false; bool flag57 = false; bool flag58 = false; bool flag59 = false; bool flag60 = false; bool flag61 = false; bool flag62 = false; bool flag63 = false; bool flag64 = false; bool flag65 = false; bool flag66 = false; bool flag67 = false; bool flag68 = false; bool flag69 = false; bool flag70 = false; bool flag71 = false; bool flag72 = false; bool flag73 = false; bool flag74 = false; bool flag75 = false; bool flag76 = false; bool flag77 = false; bool flag78 = false; bool flag79 = false; bool flag80 = false; bool flag81 = false; bool flag82 = false; bool flag83 = false; bool flag84 = false; bool flag85 = false; bool flag86 = false; bool flag87 = false; bool flag88 = false; bool flag89 = false; bool flag90 = false; bool flag91 = false; bool flag92 = false; bool flag93 = false; bool flag94 = false; bool flag95 = false; bool flag96 = false; bool flag97 = false; bool flag98 = false; bool flag99 = false; bool flag100 = false; bool flag101 = false; bool flag102 = false; bool flag103 = false; bool flag104 = false; bool flag105 = false; bool flag106 = false; bool flag107 = false; bool flag108 = false; bool flag109 = false; bool flag110 = false; bool flag111 = false; bool flag112 = false; bool flag113 = false; bool flag114 = false; bool flag115 = false; bool flag116 = false; bool flag117 = false; bool flag118 = false; bool flag119 = false; bool flag120 = false; bool flag121 = false; bool flag122 = false; bool flag123 = false; bool flag124 = false; bool flag125 = false; bool flag126 = false; bool flag127 = false; bool flag128 = false; bool flag129 = false; bool flag130 = false; bool flag131 = false; bool flag132 = false; bool flag133 = false; bool flag134 = false; bool flag135 = false; bool flag136 = false; bool flag137 = false; bool flag138 = false; bool flag139 = false; bool flag140 = false; bool flag141 = false; bool flag142 = false; bool flag143 = false; bool flag144 = false; bool flag145 = false; bool flag146 = false; bool flag147 = false; bool flag148 = false; bool flag149 = false; bool flag150 = false; bool flag151 = false; bool flag152 = false; bool flag153 = false; bool flag154 = false; bool flag155 = false; bool flag156 = false; bool flag157 = false; bool flag158 = false; bool flag159 = false; bool flag160 = false; bool flag161 = false; bool flag162 = false; bool flag163 = false; bool flag164 = false; bool flag165 = false; bool flag166 = false; bool flag167 = false; bool flag168 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".programs_config"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "SellingUnderCostOption") { flag = true; } else if (this.strName == "SellingOverQtyOption") { flag2 = true; } else if (this.strName == "InvShowRetailPriceExcl") { flag3 = true; } else if (this.strName == "DefaultInvoiceType") { flag4 = true; } else if (this.strName == "DefaultPurchaseType") { flag5 = true; } else if (this.strName == "DefaultItemType") { flag6 = true; } else if (this.strName == "StockTakeMethod") { flag7 = true; } else if (this.strName == "StockTake_ShowQtyAvailable") { flag8 = true; } else if (this.strName == "StockTake_LoadRecords") { flag9 = true; } else if (this.strName == "StockTake_AfterSavingSheet") { flag10 = true; } else if (this.strName == "StockTake_AfterSavingSheet_PrintTo") { flag11 = true; } else if (this.strName == "AfterAddingItemToGridDo") { flag12 = true; } else if (this.strName == "AfterAddingItemToGridDo_Purchases") { flag13 = true; } else if (this.strName == "StockTake_VarianceOrderBy") { flag14 = true; } else if (this.strName == "StockTake_VarianceShow") { flag15 = true; } else if (this.strName == "LinkedItemsOptions") { flag16 = true; } else if (this.strName == "PaymentMethods") { flag18 = true; } else if (this.strName == "InvSlipNote") { flag19 = true; } else if (this.strName == "QuotationSlipNote") { flag20 = true; } else if (this.strName == "PriceOverridePassword") { flag21 = true; } else if (this.strName == "PriceEmbeddedPrefix") { flag22 = true; } else if (this.strName == "ShowAmountDueOnSalesDocs") { flag17 = true; } else if (this.strName == "PrintTo_CashInvoice") { flag23 = true; } else if (this.strName == "PrintTo_Refund") { flag24 = true; } else if (this.strName == "PrintTo_Payout") { flag25 = true; } else if (this.strName == "PrintTo_AccInvoice") { flag26 = true; } else if (this.strName == "PrintTo_CreditNote") { flag27 = true; } else if (this.strName == "PrintTo_Receipt") { flag28 = true; } else if (this.strName == "PrintTo_Journal") { flag29 = true; } else if (this.strName == "PrintTo_Quotation") { flag30 = true; } else if (this.strName == "PrintTo_ProformaInvoice") { flag31 = true; } else if (this.strName == "PrintTo_IBT") { flag32 = true; } else if (this.strName == "PrintTo_IBTreturn") { flag33 = true; } else if (this.strName == "PrintTo_CashPurchase") { flag34 = true; } else if (this.strName == "PrintTo_CashPurchaseReturn") { flag35 = true; } else if (this.strName == "PrintTo_AccPurchase") { flag36 = true; } else if (this.strName == "PrintTo_DebitNote") { flag37 = true; } else if (this.strName == "PrintTo_Payment") { flag38 = true; } else if (this.strName == "PrintTo_CreditorJournal") { flag39 = true; } else if (this.strName == "PrintTo_PurchaseOrder") { flag40 = true; } else if (this.strName == "Copies_CashInvoice") { flag41 = true; } else if (this.strName == "Copies_Refund") { flag42 = true; } else if (this.strName == "Copies_Payout") { flag43 = true; } else if (this.strName == "Copies_AccInvoice") { flag44 = true; } else if (this.strName == "Copies_CreditNote") { flag45 = true; } else if (this.strName == "Copies_Receipt") { flag46 = true; } else if (this.strName == "Copies_Journal") { flag47 = true; } else if (this.strName == "Copies_Quotation") { flag48 = true; } else if (this.strName == "Copies_ProformaInvoice") { flag49 = true; } else if (this.strName == "Copies_IBT") { flag50 = true; } else if (this.strName == "Copies_IBTreturn") { flag51 = true; } else if (this.strName == "Copies_CashPurchase") { flag52 = true; } else if (this.strName == "Copies_CashPurchaseReturn") { flag53 = true; } else if (this.strName == "Copies_AccPurchase") { flag54 = true; } else if (this.strName == "Copies_DebitNote") { flag55 = true; } else if (this.strName == "Copies_Payment") { flag56 = true; } else if (this.strName == "Copies_CreditorJournal") { flag57 = true; } else if (this.strName == "Copies_PurchaseOrder") { flag58 = true; } else if (this.strName == "SlipSize_CashInvoice") { flag59 = true; } else if (this.strName == "SlipSize_Refund") { flag60 = true; } else if (this.strName == "SlipSize_Payout") { flag61 = true; } else if (this.strName == "SlipSize_AccInvoice") { flag62 = true; } else if (this.strName == "SlipSize_CreditNote") { flag63 = true; } else if (this.strName == "SlipSize_Receipt") { flag64 = true; } else if (this.strName == "SlipSize_Journal") { flag65 = true; } else if (this.strName == "SlipSize_Quotation") { flag66 = true; } else if (this.strName == "SlipSize_ProformaInvoice") { flag67 = true; } else if (this.strName == "SlipSize_IBT") { flag68 = true; } else if (this.strName == "SlipSize_IBTreturn") { flag69 = true; } else if (this.strName == "SlipSize_CashPurchase") { flag70 = true; } else if (this.strName == "SlipSize_CashPurchaseReturn") { flag71 = true; } else if (this.strName == "SlipSize_AccPurchase") { flag72 = true; } else if (this.strName == "SlipSize_DebitNote") { flag73 = true; } else if (this.strName == "SlipSize_Payment") { flag74 = true; } else if (this.strName == "SlipSize_CreditorJournal") { flag75 = true; } else if (this.strName == "SlipSize_PurchaseOrder") { flag76 = true; } else if (this.strName == "AfterTransDo1_CashInvoice") { flag77 = true; } else if (this.strName == "AfterTransDo1_Refund") { flag78 = true; } else if (this.strName == "AfterTransDo1_Payout") { flag79 = true; } else if (this.strName == "AfterTransDo1_AccInvoice") { flag80 = true; } else if (this.strName == "AfterTransDo1_CreditNote") { flag81 = true; } else if (this.strName == "AfterTransDo1_Receipt") { flag82 = true; } else if (this.strName == "AfterTransDo1_Journal") { flag83 = true; } else if (this.strName == "AfterTransDo1_Quotation") { flag84 = true; } else if (this.strName == "AfterTransDo1_ProformaInvoice") { flag85 = true; } else if (this.strName == "AfterTransDo1_IBT") { flag86 = true; } else if (this.strName == "AfterTransDo1_IBTreturn") { flag87 = true; } else if (this.strName == "AfterTransDo1_CashPurchase") { flag88 = true; } else if (this.strName == "AfterTransDo1_CashPurchaseReturn") { flag89 = true; } else if (this.strName == "AfterTransDo1_AccPurchase") { flag90 = true; } else if (this.strName == "AfterTransDo1_DebitNote") { flag91 = true; } else if (this.strName == "AfterTransDo1_Payment") { flag92 = true; } else if (this.strName == "AfterTransDo1_CreditorJournal") { flag93 = true; } else if (this.strName == "AfterTransDo1_PurchaseOrder") { flag94 = true; } else if (this.strName == "AfterTransDo2_CashInvoice") { flag95 = true; } else if (this.strName == "AfterTransDo2_Refund") { flag96 = true; } else if (this.strName == "AfterTransDo2_Payout") { flag97 = true; } else if (this.strName == "AfterTransDo2_AccInvoice") { flag98 = true; } else if (this.strName == "AfterTransDo2_CreditNote") { flag99 = true; } else if (this.strName == "AfterTransDo2_Receipt") { flag100 = true; } else if (this.strName == "AfterTransDo2_Journal") { flag101 = true; } else if (this.strName == "AfterTransDo2_Quotation") { flag102 = true; } else if (this.strName == "AfterTransDo2_ProformaInvoice") { flag103 = true; } else if (this.strName == "AfterTransDo2_IBT") { flag104 = true; } else if (this.strName == "AfterTransDo2_IBTreturn") { flag105 = true; } else if (this.strName == "AfterTransDo2_CashPurchase") { flag106 = true; } else if (this.strName == "AfterTransDo2_CashPurchaseReturn") { flag107 = true; } else if (this.strName == "AfterTransDo2_AccPurchase") { flag108 = true; } else if (this.strName == "AfterTransDo2_DebitNote") { flag109 = true; } else if (this.strName == "AfterTransDo2_Payment") { flag110 = true; } else if (this.strName == "AfterTransDo2_CreditorJournal") { flag111 = true; } else if (this.strName == "AfterTransDo2_PurchaseOrder") { flag112 = true; } else if (this.strName == "InvCustomLabel1") { flag113 = true; } else if (this.strName == "InvCustomLabel2") { flag114 = true; } else if (this.strName == "InvCustomLabel3") { flag115 = true; } else if (this.strName == "InvCustomLabel4") { flag116 = true; } else if (this.strName == "InvCustomLabel5") { flag117 = true; } else if (this.strName == "InvCustomLabel6") { flag118 = true; } else if (this.strName == "InvCustomValue1") { flag119 = true; } else if (this.strName == "InvCustomValue2") { flag120 = true; } else if (this.strName == "InvCustomValue3") { flag121 = true; } else if (this.strName == "InvCustomValue4") { flag122 = true; } else if (this.strName == "InvCustomValue5") { flag123 = true; } else if (this.strName == "InvCustomValue6") { flag124 = true; } else if (this.strName == "PurchaseCustomLabel1") { flag125 = true; } else if (this.strName == "PurchaseCustomLabel2") { flag126 = true; } else if (this.strName == "PurchaseCustomLabel3") { flag127 = true; } else if (this.strName == "PurchaseCustomLabel4") { flag128 = true; } else if (this.strName == "PurchaseCustomLabel5") { flag129 = true; } else if (this.strName == "PurchaseCustomLabel6") { flag130 = true; } else if (this.strName == "PurchaseCustomValue1") { flag131 = true; } else if (this.strName == "PurchaseCustomValue2") { flag132 = true; } else if (this.strName == "PurchaseCustomValue3") { flag133 = true; } else if (this.strName == "PurchaseCustomValue4") { flag134 = true; } else if (this.strName == "PurchaseCustomValue5") { flag135 = true; } else if (this.strName == "PurchaseCustomValue6") { flag136 = true; } else if (this.strName == "EmailAccount") { flag137 = true; } else if (this.strName == "EmailAddress") { flag138 = true; } else if (this.strName == "EmailUserName") { flag139 = true; } else if (this.strName == "EmailPassword") { flag140 = true; } else if (this.strName == "EmailSMTPAddress") { flag141 = true; } else if (this.strName == "EmailSMTPPort") { flag142 = true; } else if (this.strName == "PayOutReasons") { flag143 = true; } else if (this.strName == "CashDrawerType") { flag144 = true; } else if (this.strName == "CashDrawerComPort") { flag145 = true; } else if (this.strName == "CashDrawerKickerCode1") { flag146 = true; } else if (this.strName == "CashDrawerKickerCode2") { flag147 = true; } else if (this.strName == "CashDrawerKickerCode3") { flag148 = true; } else if (this.strName == "CashDrawerKickerCode4") { flag149 = true; } else if (this.strName == "CashDrawerKickerCode5") { flag150 = true; } else if (this.strName == "CashDrawerKickerCode6") { flag151 = true; } else if (this.strName == "CashDrawerKickerCode7") { flag152 = true; } else if (this.strName == "CashDrawerKickerCode8") { flag153 = true; } else if (this.strName == "CashDrawerSlipPrinter") { flag154 = true; } else if (this.strName == "QtyDecimalValue") { flag155 = true; } else if (this.strName == "IsPortableDatabase") { flag156 = true; } else if (this.strName == "AllowSalesDiscount") { flag161 = true; } else if (this.strName == "ShowDiscountOnSalesDocument") { flag162 = true; } else if (this.strName == "AllowPurchaseDiscount") { flag163 = true; } else if (this.strName == "ShowDiscountOnPurchaseDocument") { flag164 = true; } else if (this.strName == "RoundToValue") { flag157 = true; } else if (this.strName == "CompanyID") { flag158 = true; } else if (this.strName == "QuotationDefaultName") { flag159 = true; } else if (this.strName == "ProformaDefaultName") { flag160 = true; } else if (this.strName == "ShowSalesSidePanelPicture") { flag165 = true; } else if (this.strName == "ShowSalesSidePanelNote") { flag166 = true; } else if (this.strName == "ShowSalesSidePanelItemDetails") { flag167 = true; } else if (this.strName == "ShowSalesSidePanelAltItems") { flag168 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.programs_config ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `SellingUnderCostOption` varchar(45) NOT NULL default 'warn';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `SellingOverQtyOption` varchar(45) NOT NULL default 'warn';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `InvShowRetailPriceExcl` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `ShowAmountDueOnSalesDocs` tinyint(3) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `DefaultInvoiceType` varchar(45) NOT NULL default 'Choose';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `DefaultPurchaseType` varchar(45) NOT NULL default 'Choose';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `DefaultItemType` varchar(45) NOT NULL default 'Choose';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `StockTakeMethod` varchar(45) NOT NULL default 'WallToWall';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `StockTake_ShowQtyAvailable` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `StockTake_LoadRecords` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `StockTake_AfterSavingSheet` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `StockTake_AfterSavingSheet_PrintTo` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `StockTake_VarianceOrderBy` varchar(45) NOT NULL default 'Order variances by Description';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `StockTake_VarianceShow` varchar(45) NOT NULL default 'Show variances only';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `LinkedItemsOptions` varchar(45) NOT NULL default 'Hide linked items';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `AfterAddingItemToGridDo` varchar(45) NOT NULL default 'Goto a new line';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `AfterAddingItemToGridDo_Purchases` varchar(45) NOT NULL default 'Goto a new line';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `PaymentMethods` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `InvSlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `QuotationSlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `PriceOverridePassword` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `PriceEmbeddedPrefix` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `PrintTo_CashInvoice` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `PrintTo_Refund` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `PrintTo_Payout` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `PrintTo_AccInvoice` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `PrintTo_CreditNote` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `PrintTo_Receipt` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `PrintTo_Journal` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `PrintTo_Quotation` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `PrintTo_ProformaInvoice` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `PrintTo_IBT` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `PrintTo_IBTreturn` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `PrintTo_CashPurchase` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag35) { this.column = string.Format("{0} `PrintTo_CashPurchaseReturn` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `PrintTo_AccPurchase` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag37) { this.column = string.Format("{0} `PrintTo_DebitNote` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `PrintTo_Payment` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag39) { this.column = string.Format("{0} `PrintTo_CreditorJournal` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag40) { this.column = string.Format("{0} `PrintTo_PurchaseOrder` varchar(245) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag41) { this.column = string.Format("{0} `Copies_CashInvoice` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag42) { this.column = string.Format("{0} `Copies_Refund` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag43) { this.column = string.Format("{0} `Copies_Payout` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag44) { this.column = string.Format("{0} `Copies_AccInvoice` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag45) { this.column = string.Format("{0} `Copies_CreditNote` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag46) { this.column = string.Format("{0} `Copies_Receipt` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag47) { this.column = string.Format("{0} `Copies_Journal` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag48) { this.column = string.Format("{0} `Copies_Quotation` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag49) { this.column = string.Format("{0} `Copies_ProformaInvoice` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag50) { this.column = string.Format("{0} `Copies_IBT` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag51) { this.column = string.Format("{0} `Copies_IBTreturn` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag52) { this.column = string.Format("{0} `Copies_CashPurchase` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag53) { this.column = string.Format("{0} `Copies_CashPurchaseReturn` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag54) { this.column = string.Format("{0} `Copies_AccPurchase` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag55) { this.column = string.Format("{0} `Copies_DebitNote` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag56) { this.column = string.Format("{0} `Copies_Payment` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag57) { this.column = string.Format("{0} `Copies_CreditorJournal` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag58) { this.column = string.Format("{0} `Copies_PurchaseOrder` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag59) { this.column = string.Format("{0} `SlipSize_CashInvoice` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag60) { this.column = string.Format("{0} `SlipSize_Refund` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag61) { this.column = string.Format("{0} `SlipSize_Payout` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag62) { this.column = string.Format("{0} `SlipSize_AccInvoice` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag63) { this.column = string.Format("{0} `SlipSize_CreditNote` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag64) { this.column = string.Format("{0} `SlipSize_Receipt` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag65) { this.column = string.Format("{0} `SlipSize_Journal` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag66) { this.column = string.Format("{0} `SlipSize_Quotation` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag67) { this.column = string.Format("{0} `SlipSize_ProformaInvoice` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag68) { this.column = string.Format("{0} `SlipSize_IBT` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag69) { this.column = string.Format("{0} `SlipSize_IBTreturn` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag70) { this.column = string.Format("{0} `SlipSize_CashPurchase` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag71) { this.column = string.Format("{0} `SlipSize_CashPurchaseReturn` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag72) { this.column = string.Format("{0} `SlipSize_AccPurchase` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag73) { this.column = string.Format("{0} `SlipSize_DebitNote` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag74) { this.column = string.Format("{0} `SlipSize_Payment` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag75) { this.column = string.Format("{0} `SlipSize_CreditorJournal` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag76) { this.column = string.Format("{0} `SlipSize_PurchaseOrder` varchar(45) NOT NULL default 'A4';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag77) { this.column = string.Format("{0} `AfterTransDo1_CashInvoice` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag78) { this.column = string.Format("{0} `AfterTransDo1_Refund` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag79) { this.column = string.Format("{0} `AfterTransDo1_Payout` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag80) { this.column = string.Format("{0} `AfterTransDo1_AccInvoice` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag81) { this.column = string.Format("{0} `AfterTransDo1_CreditNote` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag82) { this.column = string.Format("{0} `AfterTransDo1_Receipt` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag83) { this.column = string.Format("{0} `AfterTransDo1_Journal` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag84) { this.column = string.Format("{0} `AfterTransDo1_Quotation` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag85) { this.column = string.Format("{0} `AfterTransDo1_ProformaInvoice` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag86) { this.column = string.Format("{0} `AfterTransDo1_IBT` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag87) { this.column = string.Format("{0} `AfterTransDo1_IBTreturn` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag88) { this.column = string.Format("{0} `AfterTransDo1_CashPurchase` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag89) { this.column = string.Format("{0} `AfterTransDo1_CashPurchaseReturn` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag90) { this.column = string.Format("{0} `AfterTransDo1_AccPurchase` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag91) { this.column = string.Format("{0} `AfterTransDo1_DebitNote` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag92) { this.column = string.Format("{0} `AfterTransDo1_Payment` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag93) { this.column = string.Format("{0} `AfterTransDo1_CreditorJournal` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag94) { this.column = string.Format("{0} `AfterTransDo1_PurchaseOrder` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag95) { this.column = string.Format("{0} `AfterTransDo2_CashInvoice` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag96) { this.column = string.Format("{0} `AfterTransDo2_Refund` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag97) { this.column = string.Format("{0} `AfterTransDo2_Payout` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag98) { this.column = string.Format("{0} `AfterTransDo2_AccInvoice` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag99) { this.column = string.Format("{0} `AfterTransDo2_CreditNote` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag100) { this.column = string.Format("{0} `AfterTransDo2_Receipt` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag101) { this.column = string.Format("{0} `AfterTransDo2_Journal` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag102) { this.column = string.Format("{0} `AfterTransDo2_Quotation` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag103) { this.column = string.Format("{0} `AfterTransDo2_ProformaInvoice` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag104) { this.column = string.Format("{0} `AfterTransDo2_IBT` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag105) { this.column = string.Format("{0} `AfterTransDo2_IBTreturn` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag106) { this.column = string.Format("{0} `AfterTransDo2_CashPurchase` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag107) { this.column = string.Format("{0} `AfterTransDo2_CashPurchaseReturn` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag108) { this.column = string.Format("{0} `AfterTransDo2_AccPurchase` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag109) { this.column = string.Format("{0} `AfterTransDo2_DebitNote` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag110) { this.column = string.Format("{0} `AfterTransDo2_Payment` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag111) { this.column = string.Format("{0} `AfterTransDo2_CreditorJournal` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag112) { this.column = string.Format("{0} `AfterTransDo2_PurchaseOrder` varchar(45) NOT NULL default 'Do nothing';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag113) { this.column = string.Format("{0} `InvCustomLabel1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag114) { this.column = string.Format("{0} `InvCustomLabel2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag115) { this.column = string.Format("{0} `InvCustomLabel3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag116) { this.column = string.Format("{0} `InvCustomLabel4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag117) { this.column = string.Format("{0} `InvCustomLabel5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag118) { this.column = string.Format("{0} `InvCustomLabel6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag119) { this.column = string.Format("{0} `InvCustomValue1` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag120) { this.column = string.Format("{0} `InvCustomValue2` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag121) { this.column = string.Format("{0} `InvCustomValue3` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag122) { this.column = string.Format("{0} `InvCustomValue4` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag123) { this.column = string.Format("{0} `InvCustomValue5` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag124) { this.column = string.Format("{0} `InvCustomValue6` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag125) { this.column = string.Format("{0} `PurchaseCustomLabel1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag126) { this.column = string.Format("{0} `PurchaseCustomLabel2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag127) { this.column = string.Format("{0} `PurchaseCustomLabel3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag128) { this.column = string.Format("{0} `PurchaseCustomLabel4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag129) { this.column = string.Format("{0} `PurchaseCustomLabel5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag130) { this.column = string.Format("{0} `PurchaseCustomLabel6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag131) { this.column = string.Format("{0} `PurchaseCustomValue1` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag132) { this.column = string.Format("{0} `PurchaseCustomValue2` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag133) { this.column = string.Format("{0} `PurchaseCustomValue3` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag134) { this.column = string.Format("{0} `PurchaseCustomValue4` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag135) { this.column = string.Format("{0} `PurchaseCustomValue5` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag136) { this.column = string.Format("{0} `PurchaseCustomValue6` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag137) { this.column = string.Format("{0} `EmailAccount` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag138) { this.column = string.Format("{0} `EmailAddress` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag139) { this.column = string.Format("{0} `EmailUserName` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag140) { this.column = string.Format("{0} `EmailPassword` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag141) { this.column = string.Format("{0} `EmailSMTPAddress` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag142) { this.column = string.Format("{0} `EmailSMTPPort` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag143) { this.column = string.Format("{0} `PayOutReasons` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag144) { this.column = string.Format("{0} `CashDrawerType` varchar(45) NOT NULL default 'None';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag145) { this.column = string.Format("{0} `CashDrawerComPort` INT(10) UNSIGNED NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag146) { this.column = string.Format("{0} `CashDrawerKickerCode1` INT(10) UNSIGNED NOT NULL default '27';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag147) { this.column = string.Format("{0} `CashDrawerKickerCode2` INT(10) UNSIGNED NOT NULL default '112';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag148) { this.column = string.Format("{0} `CashDrawerKickerCode3` INT(10) UNSIGNED NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag149) { this.column = string.Format("{0} `CashDrawerKickerCode4` INT(10) UNSIGNED NOT NULL default '100';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag150) { this.column = string.Format("{0} `CashDrawerKickerCode5` INT(10) UNSIGNED NOT NULL default '100';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag151) { this.column = string.Format("{0} `CashDrawerKickerCode6` INT(10) UNSIGNED NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag152) { this.column = string.Format("{0} `CashDrawerKickerCode7` INT(10) UNSIGNED NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag153) { this.column = string.Format("{0} `CashDrawerKickerCode8` INT(10) UNSIGNED NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag154) { this.column = string.Format("{0} `CashDrawerSlipPrinter` varchar(45) NOT NULL default 'Use default printer';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag155) { this.column = string.Format("{0} `QtyDecimalValue` INT(10) UNSIGNED NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag156) { this.column = string.Format("{0} `IsPortableDatabase` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag161) { this.column = string.Format("{0} `AllowSalesDiscount` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag162) { this.column = string.Format("{0} `ShowDiscountOnSalesDocument` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag163) { this.column = string.Format("{0} `AllowPurchaseDiscount` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag164) { this.column = string.Format("{0} `ShowDiscountOnPurchaseDocument` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag157) { this.column = string.Format("{0} `RoundToValue` INT(10) NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag158) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag159) { this.column = string.Format("{0} `QuotationDefaultName` varchar(45) NOT NULL default 'Quotation';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag160) { this.column = string.Format("{0} `ProformaDefaultName` varchar(45) NOT NULL default 'Proforma Invoice';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag165) { this.column = string.Format("{0} `ShowSalesSidePanelPicture` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag166) { this.column = string.Format("{0} `ShowSalesSidePanelNote` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag167) { this.column = string.Format("{0} `ShowSalesSidePanelItemDetails` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag168) { this.column = string.Format("{0} `ShowSalesSidePanelAltItems` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600012B RID: 299 RVA: 0x00023198 File Offset: 0x00021398 private void Update_PurchaseOrders() { if (!this.purchase_orders_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".purchase_orders "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`RefNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".purchase_orders"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "RefNo") { flag14 = true; } else if (this.strName == "TotalExcl") { flag15 = true; } else if (this.strName == "TotalVAT") { flag16 = true; } else if (this.strName == "TotalIncl") { flag17 = true; } else if (this.strName == "TransID") { flag18 = true; } else if (this.strName == "DeliveryAddress") { flag19 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.purchase_orders ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `RefNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.purchase_orders_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".purchase_orders_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag20 = false; bool flag5 = false; bool flag21 = false; bool flag2 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag4 = false; bool flag27 = false; bool flag28 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".purchase_orders_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag20 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "ProductID") { flag21 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag22 = true; } else if (this.strName == "ProductCode") { flag23 = true; } else if (this.strName == "Description") { flag24 = true; } else if (this.strName == "Qty") { flag25 = true; } else if (this.strName == "QtyAvailable") { flag26 = true; } else if (this.strName == "TotalExcl") { flag15 = true; } else if (this.strName == "TotalVAT") { flag16 = true; } else if (this.strName == "TotalIncl") { flag17 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag27 = true; } else if (this.strName == "Discount") { flag28 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.purchase_orders_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600012C RID: 300 RVA: 0x0002422C File Offset: 0x0002242C private void Update_Purchases() { if (!this.cash_purchases_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_purchases "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`InvoiceNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag20 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_purchases"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "InvoiceNo") { flag14 = true; } else if (this.strName == "InvoiceDate") { flag15 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "TotalPaid") { flag19 = true; } else if (this.strName == "TransID") { flag20 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_purchases ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `InvoiceNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.cash_purchases_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_purchases_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelCashPurchaseReturnIDs` varchar(450) NOT NULL default '',"); this.newTable.Append("`RelCashPurchaseReturnQtys` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag21 = false; bool flag5 = false; bool flag22 = false; bool flag2 = false; bool flag15 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag28 = false; bool flag29 = false; bool flag4 = false; bool flag30 = false; bool flag31 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_purchases_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag21 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "ProductID") { flag22 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "InvoiceDate") { flag15 = true; } else if (this.strName == "IsProduct") { flag23 = true; } else if (this.strName == "ProductCode") { flag24 = true; } else if (this.strName == "Description") { flag25 = true; } else if (this.strName == "Qty") { flag26 = true; } else if (this.strName == "QtyAvailable") { flag27 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "RelCashPurchaseReturnIDs") { flag28 = true; } else if (this.strName == "RelCashPurchaseReturnQtys") { flag29 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag30 = true; } else if (this.strName == "Discount") { flag31 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_purchases_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `RelCashPurchaseReturnIDs` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `RelCashPurchaseReturnQtys` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.cash_purchases_returns_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_purchases_returns "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ReturnDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedTransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag32 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag20 = false; bool flag33 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_purchases_returns"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ReturnDate") { flag32 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "TransID") { flag20 = true; } else if (this.strName == "RelatedTransID") { flag33 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_purchases_returns ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `ReturnDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `RelatedTransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.cash_purchases_returns_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_purchases_returns_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Reason` varchar(450) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag21 = false; bool flag5 = false; bool flag22 = false; bool flag2 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag34 = false; bool flag4 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_purchases_returns_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag21 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "ProductID") { flag22 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag23 = true; } else if (this.strName == "ProductCode") { flag24 = true; } else if (this.strName == "Description") { flag25 = true; } else if (this.strName == "Qty") { flag26 = true; } else if (this.strName == "QtyAvailable") { flag27 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "Reason") { flag34 = true; } else if (this.strName == "User") { flag4 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_purchases_returns_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `Reason` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.credit_purchases_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".credit_purchases "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`InvoiceNo` varchar(45) NOT NULL default '0',"); this.newTable.Append("`InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelPaymentIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalDtNotesIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelDtNoteIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag14 = false; bool flag15 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; bool flag35 = false; bool flag36 = false; bool flag37 = false; bool flag38 = false; bool flag20 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".credit_purchases"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "InvoiceNo") { flag14 = true; } else if (this.strName == "InvoiceDate") { flag15 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "TotalPaid") { flag19 = true; } else if (this.strName == "RelPaymentIDs") { flag35 = true; } else if (this.strName == "TotalDtNotesIncl") { flag36 = true; } else if (this.strName == "RelDtNoteIDs") { flag37 = true; } else if (this.strName == "StatementNote") { flag38 = true; } else if (this.strName == "TransID") { flag20 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.credit_purchases ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `InvoiceNo` varchar(45) NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag35) { this.column = string.Format("{0} `RelPaymentIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `TotalDtNotesIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag37) { this.column = string.Format("{0} `RelDtNoteIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.credit_purchases_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".credit_purchases_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelDebitNoteIDs` varchar(450) NOT NULL default '',"); this.newTable.Append("`RelDebitNoteQtys` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag21 = false; bool flag5 = false; bool flag22 = false; bool flag2 = false; bool flag15 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag39 = false; bool flag40 = false; bool flag4 = false; bool flag30 = false; bool flag31 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".credit_purchases_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag21 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "ProductID") { flag22 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "InvoiceDate") { flag15 = true; } else if (this.strName == "IsProduct") { flag23 = true; } else if (this.strName == "ProductCode") { flag24 = true; } else if (this.strName == "Description") { flag25 = true; } else if (this.strName == "Qty") { flag26 = true; } else if (this.strName == "QtyAvailable") { flag27 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "RelDebitNoteIDs") { flag39 = true; } else if (this.strName == "RelDebitNoteQtys") { flag40 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag30 = true; } else if (this.strName == "Discount") { flag31 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.credit_purchases_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `InvoiceDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag39) { this.column = string.Format("{0} `RelDebitNoteIDs` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag40) { this.column = string.Format("{0} `RelDebitNoteQtys` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.debit_notes_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".debit_notes "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`CreditNoteDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedTransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag41 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag38 = false; bool flag20 = false; bool flag33 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".debit_notes"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "CreditNoteDate") { flag41 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "StatementNote") { flag38 = true; } else if (this.strName == "TransID") { flag20 = true; } else if (this.strName == "RelatedTransID") { flag33 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.debit_notes ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag41) { this.column = string.Format("{0} `CreditNoteDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `RelatedTransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.debit_notes_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".debit_notes_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Reason` varchar(450) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag21 = false; bool flag5 = false; bool flag22 = false; bool flag2 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag34 = false; bool flag4 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".debit_notes_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag21 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "ProductID") { flag22 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag23 = true; } else if (this.strName == "ProductCode") { flag24 = true; } else if (this.strName == "Description") { flag25 = true; } else if (this.strName == "Qty") { flag26 = true; } else if (this.strName == "QtyAvailable") { flag27 = true; } else if (this.strName == "TotalExcl") { flag16 = true; } else if (this.strName == "TotalVAT") { flag17 = true; } else if (this.strName == "TotalIncl") { flag18 = true; } else if (this.strName == "Reason") { flag34 = true; } else if (this.strName == "User") { flag4 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.debit_notes_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `Reason` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.payments_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".payments "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`PurchasesID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`AmountPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`PaymentMethod` varchar(45) NOT NULL default '',"); this.newTable.Append("`IsForAccount` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag42 = false; bool flag5 = false; bool flag2 = false; bool flag6 = false; bool flag43 = false; bool flag44 = false; bool flag45 = false; bool flag4 = false; bool flag38 = false; bool flag20 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".payments"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "PurchasesID") { flag42 = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "AmountPaid") { flag43 = true; } else if (this.strName == "PaymentMethod") { flag44 = true; } else if (this.strName == "IsForAccount") { flag45 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "StatementNote") { flag38 = true; } else if (this.strName == "TransID") { flag20 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.payments ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag42) { this.column = string.Format("{0} `PurchasesID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag43) { this.column = string.Format("{0} `AmountPaid` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag44) { this.column = string.Format("{0} `PaymentMethod` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag45) { this.column = string.Format("{0} `IsForAccount` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.creditor_journals_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".creditor_journals "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`SupplierName` varchar(450) NOT NULL default '',"); this.newTable.Append("`Amount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Reason` varchar(245) NOT NULL default '',"); this.newTable.Append("`User` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelPaymentIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag5 = false; bool flag2 = false; bool flag6 = false; bool flag46 = false; bool flag34 = false; bool flag4 = false; bool flag38 = false; bool flag19 = false; bool flag35 = false; bool flag20 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".creditor_journals"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "SupplierID") { flag5 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "SupplierName") { flag6 = true; } else if (this.strName == "Amount") { flag46 = true; } else if (this.strName == "Reason") { flag34 = true; } else if (this.strName == "User") { flag4 = true; } else if (this.strName == "StatementNote") { flag38 = true; } else if (this.strName == "TotalPaid") { flag19 = true; } else if (this.strName == "RelPaymentIDs") { flag35 = true; } else if (this.strName == "TransID") { flag20 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.creditor_journals ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `SupplierName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag46) { this.column = string.Format("{0} `Amount` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `Reason` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `User` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag35) { this.column = string.Format("{0} `RelPaymentIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600012D RID: 301 RVA: 0x00029400 File Offset: 0x00027600 private void Update_Quotations() { if (!this.quotations_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".quotations "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".quotations"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag14 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalIncl") { flag16 = true; } else if (this.strName == "TransID") { flag17 = true; } else if (this.strName == "DeliveryAddress") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.quotations ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.quotations_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".quotations_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag19 = false; bool flag5 = false; bool flag20 = false; bool flag2 = false; bool flag21 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag15 = false; bool flag28 = false; bool flag4 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".quotations_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag19 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag20 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag21 = true; } else if (this.strName == "ProductCode") { flag22 = true; } else if (this.strName == "Description") { flag23 = true; } else if (this.strName == "Qty") { flag24 = true; } else if (this.strName == "QtyAvailable") { flag25 = true; } else if (this.strName == "TotalCost") { flag26 = true; } else if (this.strName == "TotalSellingExcl") { flag27 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalSellingIncl") { flag28 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag29 = true; } else if (this.strName == "Discount") { flag30 = true; } else if (this.strName == "IsOnPromotion") { flag31 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.quotations_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `TotalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600012E RID: 302 RVA: 0x0002A4FC File Offset: 0x000286FC private void Update_Invoices() { if (!this.cash_sales_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_sales "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; bool flag19 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_sales"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag14 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalIncl") { flag16 = true; } else if (this.strName == "TotalPaid") { flag17 = true; } else if (this.strName == "TransID") { flag18 = true; } else if (this.strName == "DeliveryAddress") { flag19 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_sales ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.cash_sales_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_sales_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelCashRefundIDs` varchar(450) NOT NULL default '',"); this.newTable.Append("`RelCashRefundQtys` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag20 = false; bool flag5 = false; bool flag21 = false; bool flag2 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag15 = false; bool flag29 = false; bool flag30 = false; bool flag31 = false; bool flag4 = false; bool flag32 = false; bool flag33 = false; bool flag34 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_sales_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag20 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag21 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag22 = true; } else if (this.strName == "ProductCode") { flag23 = true; } else if (this.strName == "Description") { flag24 = true; } else if (this.strName == "Qty") { flag25 = true; } else if (this.strName == "QtyAvailable") { flag26 = true; } else if (this.strName == "TotalCost") { flag27 = true; } else if (this.strName == "TotalSellingExcl") { flag28 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalSellingIncl") { flag29 = true; } else if (this.strName == "RelCashRefundIDs") { flag30 = true; } else if (this.strName == "RelCashRefundQtys") { flag31 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag32 = true; } else if (this.strName == "Discount") { flag33 = true; } else if (this.strName == "IsOnPromotion") { flag34 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_sales_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `TotalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag30) { this.column = string.Format("{0} `RelCashRefundIDs` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag31) { this.column = string.Format("{0} `RelCashRefundQtys` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.cash_refunds_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_refunds "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedTransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag18 = false; bool flag35 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_refunds"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag14 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalIncl") { flag16 = true; } else if (this.strName == "TransID") { flag18 = true; } else if (this.strName == "RelatedTransID") { flag35 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_refunds ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag35) { this.column = string.Format("{0} `RelatedTransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.cash_refunds_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".cash_refunds_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Reason` varchar(450) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag20 = false; bool flag5 = false; bool flag21 = false; bool flag2 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag15 = false; bool flag29 = false; bool flag36 = false; bool flag4 = false; bool flag34 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".cash_refunds_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag20 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag21 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag22 = true; } else if (this.strName == "ProductCode") { flag23 = true; } else if (this.strName == "Description") { flag24 = true; } else if (this.strName == "Qty") { flag25 = true; } else if (this.strName == "QtyAvailable") { flag26 = true; } else if (this.strName == "TotalCost") { flag27 = true; } else if (this.strName == "TotalSellingExcl") { flag28 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalSellingIncl") { flag29 = true; } else if (this.strName == "Reason") { flag36 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "IsOnPromotion") { flag34 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.cash_refunds_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `TotalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `Reason` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.payouts_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".payouts "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`AmountPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`VATamount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`PaymentMethod` varchar(45) NOT NULL default '',"); this.newTable.Append("`Reason` varchar(450) NOT NULL default '',"); this.newTable.Append("`RelatedNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag2 = false; bool flag37 = false; bool flag38 = false; bool flag36 = false; bool flag39 = false; bool flag40 = false; bool flag4 = false; bool flag = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".payouts"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "Date") { flag2 = true; } else if (this.strName == "AmountPaid") { flag37 = true; } else if (this.strName == "VATamount") { flag39 = true; } else if (this.strName == "PaymentMethod") { flag38 = true; } else if (this.strName == "Reason") { flag36 = true; } else if (this.strName == "RelatedNo") { flag40 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "TransID") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.payouts ADD COLUMN", this.databaseName); if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag37) { this.column = string.Format("{0} `AmountPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag39) { this.column = string.Format("{0} `VATamount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `PaymentMethod` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `Reason` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag40) { this.column = string.Format("{0} `RelatedNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.credit_sales_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".credit_sales "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelReceiptIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalCrNotesIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelCrNoteIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`DeliveryAddress` text NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag41 = false; bool flag42 = false; bool flag43 = false; bool flag44 = false; bool flag18 = false; bool flag19 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".credit_sales"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag14 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalIncl") { flag16 = true; } else if (this.strName == "TotalPaid") { flag17 = true; } else if (this.strName == "RelReceiptIDs") { flag41 = true; } else if (this.strName == "TotalCrNotesIncl") { flag42 = true; } else if (this.strName == "RelCrNoteIDs") { flag43 = true; } else if (this.strName == "StatementNote") { flag44 = true; } else if (this.strName == "TransID") { flag18 = true; } else if (this.strName == "DeliveryAddress") { flag19 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.credit_sales ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag41) { this.column = string.Format("{0} `RelReceiptIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag42) { this.column = string.Format("{0} `TotalCrNotesIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag43) { this.column = string.Format("{0} `RelCrNoteIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag44) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag19) { this.column = string.Format("{0} `DeliveryAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.credit_sales_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".credit_sales_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelCreditNoteIDs` varchar(450) NOT NULL default '',"); this.newTable.Append("`RelCreditNoteQtys` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`Discount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag20 = false; bool flag5 = false; bool flag21 = false; bool flag2 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag15 = false; bool flag29 = false; bool flag45 = false; bool flag46 = false; bool flag4 = false; bool flag32 = false; bool flag33 = false; bool flag34 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".credit_sales_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag20 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag21 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag22 = true; } else if (this.strName == "ProductCode") { flag23 = true; } else if (this.strName == "Description") { flag24 = true; } else if (this.strName == "Qty") { flag25 = true; } else if (this.strName == "QtyAvailable") { flag26 = true; } else if (this.strName == "TotalCost") { flag27 = true; } else if (this.strName == "TotalSellingExcl") { flag28 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalSellingIncl") { flag29 = true; } else if (this.strName == "RelCreditNoteIDs") { flag45 = true; } else if (this.strName == "RelCreditNoteQtys") { flag46 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "OrigUnitPrice") { flag32 = true; } else if (this.strName == "Discount") { flag33 = true; } else if (this.strName == "IsOnPromotion") { flag34 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.credit_sales_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `totalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag45) { this.column = string.Format("{0} `RelCreditNoteIDs` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag46) { this.column = string.Format("{0} `RelCreditNoteQtys` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag32) { this.column = string.Format("{0} `OrigUnitPrice` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag33) { this.column = string.Format("{0} `Discount` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.credit_notes_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".credit_notes "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ComputerName` varchar(45) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`SlipNote` text NOT NULL default '',"); this.newTable.Append("`Custom1` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom2` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom3` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom4` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom5` varchar(45) NOT NULL default '',"); this.newTable.Append("`Custom6` varchar(45) NOT NULL default '',"); this.newTable.Append("`TotalExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedTransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag44 = false; bool flag18 = false; bool flag35 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".credit_notes"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ComputerName") { flag3 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "SlipNote") { flag7 = true; } else if (this.strName == "Custom1") { flag8 = true; } else if (this.strName == "Custom2") { flag9 = true; } else if (this.strName == "Custom3") { flag10 = true; } else if (this.strName == "Custom4") { flag11 = true; } else if (this.strName == "Custom5") { flag12 = true; } else if (this.strName == "Custom6") { flag13 = true; } else if (this.strName == "TotalExcl") { flag14 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalIncl") { flag16 = true; } else if (this.strName == "StatementNote") { flag44 = true; } else if (this.strName == "TransID") { flag18 = true; } else if (this.strName == "RelatedTransID") { flag35 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.credit_notes ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `ComputerName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `SlipNote` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `Custom1` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `Custom2` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `Custom3` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `Custom4` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `Custom5` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `Custom6` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `TotalExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalTax` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag44) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag35) { this.column = string.Format("{0} `RelatedTransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.credit_notes_items_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".credit_notes_items "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`RelatedID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`IsProduct` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`ProductCode` varchar(45) NOT NULL default '',"); this.newTable.Append("`Description` varchar(450) NOT NULL default '',"); this.newTable.Append("`Qty` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`QtyAvailable` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`TotalCost` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalVAT` decimal(14,4) NOT NULL default '0.0000',"); this.newTable.Append("`TotalSellingIncl` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Reason` varchar(450) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`IsOnPromotion` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag20 = false; bool flag5 = false; bool flag21 = false; bool flag2 = false; bool flag22 = false; bool flag23 = false; bool flag24 = false; bool flag25 = false; bool flag26 = false; bool flag27 = false; bool flag28 = false; bool flag15 = false; bool flag29 = false; bool flag36 = false; bool flag4 = false; bool flag34 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".credit_notes_items"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "RelatedID") { flag20 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "ProductID") { flag21 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "IsProduct") { flag22 = true; } else if (this.strName == "ProductCode") { flag23 = true; } else if (this.strName == "Description") { flag24 = true; } else if (this.strName == "Qty") { flag25 = true; } else if (this.strName == "QtyAvailable") { flag26 = true; } else if (this.strName == "TotalCost") { flag27 = true; } else if (this.strName == "TotalSellingExcl") { flag28 = true; } else if (this.strName == "TotalVAT") { flag15 = true; } else if (this.strName == "TotalSellingIncl") { flag29 = true; } else if (this.strName == "Reason") { flag36 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "IsOnPromotion") { flag34 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.credit_notes_items ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag20) { this.column = string.Format("{0} `RelatedID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag21) { this.column = string.Format("{0} `ProductID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag22) { this.column = string.Format("{0} `IsProduct` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag23) { this.column = string.Format("{0} `ProductCode` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag24) { this.column = string.Format("{0} `Description` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag25) { this.column = string.Format("{0} `Qty` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag26) { this.column = string.Format("{0} `QtyAvailable` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag27) { this.column = string.Format("{0} `TotalCost` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag28) { this.column = string.Format("{0} `TotalSellingExcl` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `TotalVAT` decimal(14,4) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag29) { this.column = string.Format("{0} `TotalSellingIncl` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `Reason` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag34) { this.column = string.Format("{0} `IsOnPromotion` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.receipts_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".receipts "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`SalesID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`AmountPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`PaymentMethod` varchar(45) NOT NULL default '',"); this.newTable.Append("`IsForAccount` tinyint(3) unsigned NOT NULL default '0',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag47 = false; bool flag5 = false; bool flag2 = false; bool flag6 = false; bool flag37 = false; bool flag38 = false; bool flag48 = false; bool flag4 = false; bool flag44 = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".receipts"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "SalesID") { flag47 = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "AmountPaid") { flag37 = true; } else if (this.strName == "PaymentMethod") { flag38 = true; } else if (this.strName == "IsForAccount") { flag48 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "StatementNote") { flag44 = true; } else if (this.strName == "TransID") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.receipts ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag47) { this.column = string.Format("{0} `SalesID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag37) { this.column = string.Format("{0} `AmountPaid` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag38) { this.column = string.Format("{0} `PaymentMethod` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag48) { this.column = string.Format("{0} `IsForAccount` tinyint(3) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag44) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } if (!this.debtor_journals_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".debtor_journals "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`ClientID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Date` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`ClientName` varchar(450) NOT NULL default '',"); this.newTable.Append("`Amount` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Reason` varchar(245) NOT NULL default '',"); this.newTable.Append("`SalesRep` varchar(45) NOT NULL default '',"); this.newTable.Append("`StatementNote` varchar(150) NOT NULL default '',"); this.newTable.Append("`TotalPaid` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`RelReceiptIDs` varchar(45) NOT NULL default '',"); this.newTable.Append("`TransID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag5 = false; bool flag2 = false; bool flag6 = false; bool flag49 = false; bool flag36 = false; bool flag4 = false; bool flag44 = false; bool flag17 = false; bool flag41 = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".debtor_journals"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "ClientID") { flag5 = true; } else if (this.strName == "Date") { flag2 = true; } else if (this.strName == "ClientName") { flag6 = true; } else if (this.strName == "Amount") { flag49 = true; } else if (this.strName == "Reason") { flag36 = true; } else if (this.strName == "SalesRep") { flag4 = true; } else if (this.strName == "StatementNote") { flag44 = true; } else if (this.strName == "TotalPaid") { flag17 = true; } else if (this.strName == "RelReceiptIDs") { flag41 = true; } else if (this.strName == "TransID") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.debtor_journals ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ClientID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Date` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `ClientName` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag49) { this.column = string.Format("{0} `Amount` decimal(14,2) NOT NULL default '0.0000';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag36) { this.column = string.Format("{0} `Reason` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `SalesRep` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag44) { this.column = string.Format("{0} `StatementNote` varchar(150) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `TotalPaid` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag41) { this.column = string.Format("{0} `RelReceiptIDs` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `TransID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0600012F RID: 303 RVA: 0x0002FC68 File Offset: 0x0002DE68 private void Update_Suppliers() { if (!this.suppliers_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".suppliers "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`SupplierID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`Name` varchar(245) NOT NULL default '',"); this.newTable.Append("`Email` varchar(450) NOT NULL default '',"); this.newTable.Append("`BillingAddress` text NOT NULL default '',"); this.newTable.Append("`ContactNo` varchar(45) NOT NULL default '',"); this.newTable.Append("`BankingDetails` text NOT NULL default '',"); this.newTable.Append("`TaxOnInvoice` varchar(45) NOT NULL default 'Exclusive',"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`LastTransDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastCashPurchaseDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastCashPurchaseReturnDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastAccountPurchaseDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastDebitNoteDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastPaymentDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`LastJournalDate` datetime NOT NULL default '2000-01-01 01:00:00',"); this.newTable.Append("`TotalDue` decimal(14,2) NOT NULL default '0.00',"); this.newTable.Append("`Note` text NOT NULL default '',"); this.newTable.Append("`Status` varchar(45) NOT NULL default 'Active',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".suppliers"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "Name") { flag2 = true; } else if (this.strName == "SupplierID") { flag = true; } else if (this.strName == "Email") { flag3 = true; } else if (this.strName == "BillingAddress") { flag4 = true; } else if (this.strName == "ContactNo") { flag5 = true; } else if (this.strName == "BankingDetails") { flag6 = true; } else if (this.strName == "TaxOnInvoice") { flag7 = true; } else if (this.strName == "CompanyID") { flag8 = true; } else if (this.strName == "LastTransDate") { flag9 = true; } else if (this.strName == "LastCashPurchaseDate") { flag10 = true; } else if (this.strName == "LastCashPurchaseReturnDate") { flag11 = true; } else if (this.strName == "LastAccountPurchaseDate") { flag12 = true; } else if (this.strName == "LastDebitNoteDate") { flag13 = true; } else if (this.strName == "LastPaymentDate") { flag14 = true; } else if (this.strName == "LastJournalDate") { flag15 = true; } else if (this.strName == "TotalDue") { flag16 = true; } else if (this.strName == "Note") { flag17 = true; } else if (this.strName == "Status") { flag18 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.suppliers ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `SupplierID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `Name` varchar(245) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `Email` varchar(450) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `BillingAddress` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ContactNo` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `BankingDetails` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `TaxOnInvoice` varchar(45) NOT NULL default 'Exclusive';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag9) { this.column = string.Format("{0} `LastTransDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag10) { this.column = string.Format("{0} `LastCashPurchaseDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag11) { this.column = string.Format("{0} `LastCashPurchaseReturnDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag12) { this.column = string.Format("{0} `LastAccountPurchaseDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag13) { this.column = string.Format("{0} `LastDebitNoteDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag14) { this.column = string.Format("{0} `LastPaymentDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag15) { this.column = string.Format("{0} `LastJournalDate` datetime NOT NULL default '2000-01-01 01:00:00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag16) { this.column = string.Format("{0} `TotalDue` decimal(14,2) NOT NULL default '0.00';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag17) { this.column = string.Format("{0} `Note` text NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag18) { this.column = string.Format("{0} `Status` varchar(45) NOT NULL default 'Active';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x06000130 RID: 304 RVA: 0x000304EC File Offset: 0x0002E6EC private void Update_Users() { if (!this.users_Found) { this.newTable.Append("CREATE TABLE " + this.databaseName + ".users "); this.newTable.Append("(`ID` int(10) unsigned NOT NULL auto_increment,"); this.newTable.Append("`CompanyID` int(10) unsigned NOT NULL default '1',"); this.newTable.Append("`UserName` varchar(45) NOT NULL default '',"); this.newTable.Append("`Password` varchar(45) NOT NULL default '',"); this.newTable.Append("`NickName` varchar(45) NOT NULL default '',"); this.newTable.Append("`ProgramsToUse` varchar(6000) NOT NULL default '',"); this.newTable.Append("`UserRights` TEXT NOT NULL default '',"); this.newTable.Append("`UserID` int(10) unsigned NOT NULL default '0',"); this.newTable.Append("`PictureName` varchar(145) NOT NULL default '',"); this.newTable.Append("PRIMARY KEY (`ID`)) ENGINE = InnoDB;\r\n"); this.sbFinal.Append(this.newTable.ToString()); this.newTable.Clear(); } else { bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; this.SqlQuery = "SHOW COLUMNS FROM " + this.databaseName + ".users"; this.cmmMySql.CommandText = this.SqlQuery; this.drMySql = this.cmmMySql.ExecuteReader(); if (this.drMySql.HasRows) { while (this.drMySql.Read()) { this.strName = this.drMySql.GetString(0); if (this.strName == "CompanyID") { flag = true; } else if (this.strName == "UserName") { flag2 = true; } else if (this.strName == "Password") { flag3 = true; } else if (this.strName == "NickName") { flag4 = true; } else if (this.strName == "ProgramsToUse") { flag5 = true; } else if (this.strName == "UserRights") { flag6 = true; } else if (this.strName == "UserID") { flag7 = true; } else if (this.strName == "PictureName") { flag8 = true; } } } this.drMySql.Close(); this.columnFirstPart = string.Format("ALTER TABLE {0}.users ADD COLUMN", this.databaseName); if (!flag) { this.column = string.Format("{0} `CompanyID` int(10) unsigned NOT NULL default '1';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag2) { this.column = string.Format("{0} `UserName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag3) { this.column = string.Format("{0} `Password` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag4) { this.column = string.Format("{0} `NickName` varchar(45) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag5) { this.column = string.Format("{0} `ProgramsToUse` varchar(6000) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag6) { this.column = string.Format("{0} `UserRights` TEXT NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag7) { this.column = string.Format("{0} `UserID` int(10) unsigned NOT NULL default '0';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } if (!flag8) { this.column = string.Format("{0} `PictureName` varchar(145) NOT NULL default '';\r\n", this.columnFirstPart); this.sbFinal.Append(this.column); } this.newTable.Clear(); } } // Token: 0x0400000E RID: 14 private const string _configureProgram = "Do Configurations to this program"; // Token: 0x0400000F RID: 15 private const string _useTools = "Use Tools on Main Screen"; // Token: 0x04000010 RID: 16 private const string overrideSellingPrice = "Allow to change selling prices"; // Token: 0x04000011 RID: 17 private const string manageClients = "Manage Clients"; // Token: 0x04000012 RID: 18 private const string doSalesDiscount = "Allow to give Sales Discounts"; // Token: 0x04000013 RID: 19 private const string manageSalesItems = "Manage Items on Invoices"; // Token: 0x04000014 RID: 20 private const string doPreviousSalesTransactions = "Invoices - Access to Previous Transactions"; // Token: 0x04000015 RID: 21 private const string doReprintLastSalesTransactions = "Invoices - Reprint last Transaction"; // Token: 0x04000016 RID: 22 private const string doSalesRefunds = "Allow Sale Refunds"; // Token: 0x04000017 RID: 23 private const string doPayouts = "Allow Payouts"; // Token: 0x04000018 RID: 24 private const string doAccountInvoices = "Allow Account Invoices"; // Token: 0x04000019 RID: 25 private const string doCreditNotes = "Allow Sale Credit Notes"; // Token: 0x0400001A RID: 26 private const string doSalesReceipts = "Allow Account Payments from Clients"; // Token: 0x0400001B RID: 27 private const string doSalesJournals = "Allow Account Journals to Clients"; // Token: 0x0400001C RID: 28 private const string doQuotations = "Allow Quotations"; // Token: 0x0400001D RID: 29 private const string doProformaInvoices = "Allow Proforma Invoices"; // Token: 0x0400001E RID: 30 private const string editInvoices = "Edit previous Invoices"; // Token: 0x0400001F RID: 31 private const string doIBT = "Allow Inter-branch Transfers (IBT`s)"; // Token: 0x04000020 RID: 32 private const string doIBTReturns = "Allow IBT Returns"; // Token: 0x04000021 RID: 33 private const string allowNegativeQty_Sales = "Allow Negative Qty`s in grid"; // Token: 0x04000022 RID: 34 private const string changeDescription_Sales = "Change item`s description in sales grid"; // Token: 0x04000023 RID: 35 private const string manageSuppliers = "Manage Suppliers"; // Token: 0x04000024 RID: 36 private const string doPurchasesDiscount = "Allow to give purchase Discounts"; // Token: 0x04000025 RID: 37 private const string managePurchasesItems = "Manage Items on Purchases"; // Token: 0x04000026 RID: 38 private const string doPreviousPurchasesTransactions = "Purchases - Access to Previous Transactions"; // Token: 0x04000027 RID: 39 private const string doReprintLastPurchasesTransactions = "Purchases - Reprint last Transaction"; // Token: 0x04000028 RID: 40 private const string doPurchasesReturns = "Allow Purchases Returns"; // Token: 0x04000029 RID: 41 private const string doAccountPurchases = "Allow Account Purchases"; // Token: 0x0400002A RID: 42 private const string doDebitNotes = "Allow Purchases Debit Notes"; // Token: 0x0400002B RID: 43 private const string doPurchasesPayments = "Allow Account Payments to Suppliers"; // Token: 0x0400002C RID: 44 private const string doPurchasesJournals = "Allow Account Journals to Suppliers"; // Token: 0x0400002D RID: 45 private const string doPurchaseOrders = "Allow Purchase Orders"; // Token: 0x0400002E RID: 46 private const string editPurchases = "Edit previous Purchases"; // Token: 0x0400002F RID: 47 private const string allowNegativeQty_Purchases = "Allow Negative Qty`s in purchase grid"; // Token: 0x04000030 RID: 48 private const string changeDescription_Purchases = "Change item`s description in purchase grid"; // Token: 0x04000031 RID: 49 public const string appName = "PPOS"; // Token: 0x04000032 RID: 50 private const string AfterAddingItemToGrid_NewLine = "Goto a new line"; // Token: 0x04000033 RID: 51 private const string AfterAddingItemToGrid_GotoQty = "Goto the Qty column"; // Token: 0x04000034 RID: 52 private const string AfterAddingItemToGrid_GotoPrice = "Goto the Price column"; // Token: 0x04000035 RID: 53 private const string Conf_DoNothing = "Do nothing"; // Token: 0x04000036 RID: 54 private const string Conf_Warn = "Warn the user"; // Token: 0x04000037 RID: 55 private const string Conf_Prevent = "Prevent the user"; // Token: 0x04000038 RID: 56 private const string Conf_ExcludingVAT = "Excluding VAT"; // Token: 0x04000039 RID: 57 private const string Conf_IncludingVAT = "Including VAT"; // Token: 0x0400003A RID: 58 private const string Conf_SalesTypeCash = "Cash Invoice"; // Token: 0x0400003B RID: 59 private const string Conf_SalesTypeAccount = "Account Invoice"; // Token: 0x0400003C RID: 60 private const string Conf_TypeChoose = "Let me choose"; // Token: 0x0400003D RID: 61 private const string Conf_PurchaseTypeCash = "Cash Purchase"; // Token: 0x0400003E RID: 62 private const string Conf_PurchaseTypeAccount = "Account Purchase"; // Token: 0x0400003F RID: 63 private const string Conf_ItemTypeDetails = "Item Details"; // Token: 0x04000040 RID: 64 private const string Conf_ItemTypeStockTake = "Stock Take"; // Token: 0x04000041 RID: 65 private const string Conf_LinkedItemsHide = " Hide linked items"; // Token: 0x04000042 RID: 66 private const string Conf_LinkedItemsShow = " Show linked items"; // Token: 0x04000043 RID: 67 private const string Conf_StockTakeTypeWall = "Wall to Wall"; // Token: 0x04000044 RID: 68 private const string Conf_StockTakeTypeLocation = "Location"; // Token: 0x04000045 RID: 69 private const string Conf_StockTakeTypeSubLocation = "Sub-Location"; // Token: 0x04000046 RID: 70 private const string Conf_StockTakeTypeCategory = "Category"; // Token: 0x04000047 RID: 71 private const string Conf_StockTakeTypeSubCategory = "Sub-Category"; // Token: 0x04000048 RID: 72 private const string Conf_DrawerTypeNone = "None"; // Token: 0x04000049 RID: 73 private const string Conf_DrawerTypeUSB = "USB to Com/Com"; // Token: 0x0400004A RID: 74 private const string Conf_DrawerTypeRJ11 = "RJ11 (back of slip printer)"; // Token: 0x0400004B RID: 75 internal const string useDefaultPrinterString = "use default printer"; // Token: 0x0400004C RID: 76 private Form frmPopupMenu = new Form(); // Token: 0x0400004D RID: 77 private FlowLayoutPanel flpMenu = new FlowLayoutPanel(); // Token: 0x0400004E RID: 78 private DataTable itemData = new DataTable(); // Token: 0x0400004F RID: 79 public Control callingControl = new Control(); // Token: 0x04000050 RID: 80 private int vertScrollWidth = SystemInformation.VerticalScrollBarWidth + 5; // Token: 0x04000051 RID: 81 private MySqlConnection conn; // Token: 0x04000052 RID: 82 private MySqlCommand cmd; // Token: 0x04000053 RID: 83 private MySqlBackup mb; // Token: 0x04000054 RID: 84 private System.Windows.Forms.Timer timer1; // Token: 0x04000055 RID: 85 private System.Windows.Forms.Timer timer2; // Token: 0x04000056 RID: 86 private BackgroundWorker bwExport; // Token: 0x04000057 RID: 87 private BackgroundWorker bwImport; // Token: 0x04000058 RID: 88 private BackgroundWorker bwCopy; // Token: 0x04000059 RID: 89 public string lastBackupFolder = string.Empty; // Token: 0x0400005A RID: 90 private string restoreFileName = string.Empty; // Token: 0x0400005B RID: 91 private string dumpFile = string.Empty; // Token: 0x0400005C RID: 92 private string backupPath = string.Empty; // Token: 0x0400005D RID: 93 private string _currentTableName = ""; // Token: 0x0400005E RID: 94 private int _totalRowsInCurrentTable = 0; // Token: 0x0400005F RID: 95 private int _totalRowsInAllTables = 0; // Token: 0x04000060 RID: 96 private int _currentRowIndexInCurrentTable = 0; // Token: 0x04000061 RID: 97 private int _currentRowIndexInAllTable = 0; // Token: 0x04000062 RID: 98 private int _totalTables = 0; // Token: 0x04000063 RID: 99 private int _currentTableIndex = 0; // Token: 0x04000064 RID: 100 private int curBytes; // Token: 0x04000065 RID: 101 private int totalBytes; // Token: 0x04000066 RID: 102 private int fileCount = 0; // Token: 0x04000067 RID: 103 private int currFile = 0; // Token: 0x04000068 RID: 104 private string sourcePath = string.Empty; // Token: 0x04000069 RID: 105 private string destinationPath = string.Empty; // Token: 0x0400006A RID: 106 private string backupError = string.Empty; // Token: 0x0400006B RID: 107 private string restoreError = string.Empty; // Token: 0x0400006C RID: 108 private string fileCopyError = string.Empty; // Token: 0x0400006D RID: 109 public frm.operationMode recordStatus = frm.operationMode.NA; // Token: 0x0400006E RID: 110 private string currentScheme = string.Empty; // Token: 0x0400006F RID: 111 private string logoName = string.Empty; // Token: 0x04000070 RID: 112 private string styleName = string.Empty; // Token: 0x04000071 RID: 113 private string stylesFolder = AppDomain.CurrentDomain.BaseDirectory + "Resources\\DocStyles"; // Token: 0x04000072 RID: 114 private string logosFolder = AppDomain.CurrentDomain.BaseDirectory + "Resources\\Logos\\"; // Token: 0x04000073 RID: 115 private Image imgLogo; // Token: 0x04000074 RID: 116 private Image imgStyle; // Token: 0x04000075 RID: 117 public Dictionary FinYearStartMonth = new Dictionary(); // Token: 0x04000076 RID: 118 private string prevVatNumber = string.Empty; // Token: 0x04000077 RID: 119 private bool preventItemCheckEvent = false; // Token: 0x04000078 RID: 120 private StringBuilder programsToUse = new StringBuilder(); // Token: 0x04000079 RID: 121 public frm.selProgramOptions SelProgramOptions = frm.selProgramOptions.NA; // Token: 0x0400007A RID: 122 private Dictionary dictPPOSOptions = new Dictionary(); // Token: 0x0400007B RID: 123 private Dictionary dictInvoicesOptions = new Dictionary(); // Token: 0x0400007C RID: 124 private Dictionary dictPurchasesOptions = new Dictionary(); // Token: 0x0400007D RID: 125 private StringBuilder strFinalProgramOptions = new StringBuilder(); // Token: 0x0400007E RID: 126 public MySqlConnection cnnMySql = new MySqlConnection(); // Token: 0x0400007F RID: 127 public MySqlDataReader drMySql; // Token: 0x04000080 RID: 128 public MySqlCommand cmmMySql = new MySqlCommand(); // Token: 0x04000081 RID: 129 public string databaseName = string.Empty; // Token: 0x04000082 RID: 130 public string serverName = string.Empty; // Token: 0x04000083 RID: 131 public string portName = string.Empty; // Token: 0x04000084 RID: 132 public string userName = string.Empty; // Token: 0x04000085 RID: 133 public string passWord = string.Empty; // Token: 0x04000086 RID: 134 private System.Windows.Forms.Timer tConnectionStatus = new System.Windows.Forms.Timer(); // Token: 0x04000087 RID: 135 private bool isConnected = false; // Token: 0x04000088 RID: 136 private Form frmMask = new Form(); // Token: 0x04000089 RID: 137 private Form FrmMessage = new Form(); // Token: 0x0400008A RID: 138 private TableLayoutPanel tlpMessage = new TableLayoutPanel(); // Token: 0x0400008B RID: 139 private Label lblMessage = new Label(); // Token: 0x0400008C RID: 140 private Label lblSubMessage = new Label(); // Token: 0x0400008D RID: 141 private Button btnMessageOK = new Button(); // Token: 0x0400008E RID: 142 private Button btnMessageCancel = new Button(); // Token: 0x0400008F RID: 143 private Button btnMessageClose = new Button(); // Token: 0x04000090 RID: 144 public frm.MessageReturn msgReturn = frm.MessageReturn.NA; // Token: 0x04000091 RID: 145 public Flyout Rightflyout; // Token: 0x04000092 RID: 146 private System.Windows.Forms.Timer tHandelScreenRotation = new System.Windows.Forms.Timer(); // Token: 0x04000093 RID: 147 public string mainConfigurationFile = AppDomain.CurrentDomain.BaseDirectory + "Configuration.xml"; // Token: 0x04000094 RID: 148 private bool FirstTimeUseSetup = false; // Token: 0x04000095 RID: 149 public bool changingCompany = false; // Token: 0x04000096 RID: 150 public bool purchasesModuleExist = File.Exists(AppDomain.CurrentDomain.BaseDirectory + "Programs\\Purchases.exe"); // Token: 0x04000097 RID: 151 public bool itemsModuleExist = File.Exists(AppDomain.CurrentDomain.BaseDirectory + "Programs\\Items.exe"); // Token: 0x04000098 RID: 152 private string licenceFileName = AppDomain.CurrentDomain.BaseDirectory + "Resources\\InvPro.xml"; // Token: 0x04000099 RID: 153 public frm.licenceVal licenceResult = frm.licenceVal.NA; // Token: 0x0400009A RID: 154 public DateTime dateFromXml; // Token: 0x0400009B RID: 155 public frm.dbType databaseType = frm.dbType.local; // Token: 0x0400009C RID: 156 public bool isMultiUser = false; // Token: 0x0400009D RID: 157 public int currentCompanyID = 0; // Token: 0x0400009E RID: 158 public string currentCompanyName = string.Empty; // Token: 0x0400009F RID: 159 public string serverNameFromConfig = string.Empty; // Token: 0x040000A0 RID: 160 public string serverIPFromConfig = string.Empty; // Token: 0x040000A1 RID: 161 public string serverPath = string.Empty; // Token: 0x040000A2 RID: 162 private bool isPortable = false; // Token: 0x040000A3 RID: 163 private frm.AfterAddingItemToGrid afterAddingItemToGrid = frm.AfterAddingItemToGrid.NewLine; // Token: 0x040000A4 RID: 164 public Dictionary dictAfterAddingItemToGrid = new Dictionary(); // Token: 0x040000A5 RID: 165 private Form FrmNotification = new Form(); // Token: 0x040000A6 RID: 166 private TableLayoutPanel tlpNotification = new TableLayoutPanel(); // Token: 0x040000A7 RID: 167 private Label lblNotificationMessage = new Label(); // Token: 0x040000A8 RID: 168 private Label lblNotificationSubMessage = new Label(); // Token: 0x040000A9 RID: 169 private System.Windows.Forms.Timer tNotifyWait; // Token: 0x040000AA RID: 170 private System.Windows.Forms.Timer tNotifyHide; // Token: 0x040000AB RID: 171 private bool configureProgram = false; // Token: 0x040000AC RID: 172 private bool useTools = false; // Token: 0x040000AD RID: 173 private string userLoggedIn = string.Empty; // Token: 0x040000AE RID: 174 private string strName = string.Empty; // Token: 0x040000AF RID: 175 private string SqlQuery = string.Empty; // Token: 0x040000B0 RID: 176 private string column = string.Empty; // Token: 0x040000B1 RID: 177 private string columnFirstPart = string.Empty; // Token: 0x040000B2 RID: 178 private StringBuilder newTable = new StringBuilder(); // Token: 0x040000B3 RID: 179 private StringBuilder sbFinal = new StringBuilder(); // Token: 0x040000B4 RID: 180 private bool companies_Found = false; // Token: 0x040000B5 RID: 181 private bool users_Found = false; // Token: 0x040000B6 RID: 182 private bool programs_config_Found = false; // Token: 0x040000B7 RID: 183 private bool workstation_config_Found = false; // Token: 0x040000B8 RID: 184 private bool workstation_state_Found = false; // Token: 0x040000B9 RID: 185 private bool products_Found = false; // Token: 0x040000BA RID: 186 private bool item_maintenance_Found = false; // Token: 0x040000BB RID: 187 private bool label_generator_config_Found = false; // Token: 0x040000BC RID: 188 private bool label_generator_batch_Found = false; // Token: 0x040000BD RID: 189 private bool linked_items_Found = false; // Token: 0x040000BE RID: 190 private bool alt_supplier_codes_Found = false; // Token: 0x040000BF RID: 191 private bool convert_items_Found = false; // Token: 0x040000C0 RID: 192 private bool clients_Found = false; // Token: 0x040000C1 RID: 193 private bool cash_sales_Found = false; // Token: 0x040000C2 RID: 194 private bool cash_sales_items_Found = false; // Token: 0x040000C3 RID: 195 private bool cash_refunds_Found = false; // Token: 0x040000C4 RID: 196 private bool cash_refunds_items_Found = false; // Token: 0x040000C5 RID: 197 private bool payouts_Found = false; // Token: 0x040000C6 RID: 198 private bool receipts_Found = false; // Token: 0x040000C7 RID: 199 private bool credit_sales_Found = false; // Token: 0x040000C8 RID: 200 private bool credit_sales_items_Found = false; // Token: 0x040000C9 RID: 201 private bool credit_notes_Found = false; // Token: 0x040000CA RID: 202 private bool credit_notes_items_Found = false; // Token: 0x040000CB RID: 203 private bool debtor_journals_Found = false; // Token: 0x040000CC RID: 204 private bool quotations_Found = false; // Token: 0x040000CD RID: 205 private bool quotations_items_Found = false; // Token: 0x040000CE RID: 206 private bool proforma_invoices_Found = false; // Token: 0x040000CF RID: 207 private bool proforma_invoices_items_Found = false; // Token: 0x040000D0 RID: 208 private bool ibt_Found = false; // Token: 0x040000D1 RID: 209 private bool ibt_items_Found = false; // Token: 0x040000D2 RID: 210 private bool ibt_returns_Found = false; // Token: 0x040000D3 RID: 211 private bool ibt_returns_items_Found = false; // Token: 0x040000D4 RID: 212 private bool suppliers_Found = false; // Token: 0x040000D5 RID: 213 private bool cash_purchases_Found = false; // Token: 0x040000D6 RID: 214 private bool cash_purchases_items_Found = false; // Token: 0x040000D7 RID: 215 private bool cash_purchases_returns_Found = false; // Token: 0x040000D8 RID: 216 private bool cash_purchases_returns_items_Found = false; // Token: 0x040000D9 RID: 217 private bool payments_Found = false; // Token: 0x040000DA RID: 218 private bool credit_purchases_Found = false; // Token: 0x040000DB RID: 219 private bool credit_purchases_items_Found = false; // Token: 0x040000DC RID: 220 private bool debit_notes_Found = false; // Token: 0x040000DD RID: 221 private bool debit_notes_items_Found = false; // Token: 0x040000DE RID: 222 private bool creditor_journals_Found = false; // Token: 0x040000DF RID: 223 private bool purchase_orders_Found = false; // Token: 0x040000E0 RID: 224 private bool purchase_orders_items_Found = false; // Token: 0x040000E1 RID: 225 private bool emails_sent_history_Found = false; // Token: 0x040000E2 RID: 226 private bool bookmarks_Found = false; // Token: 0x040000E3 RID: 227 private bool bookmarks_items_Found = false; // Token: 0x040000E4 RID: 228 public frm.schemeName SchemeColor = frm.schemeName.Default; // Token: 0x040000E5 RID: 229 private Color schemeBackColor = Color.FromArgb(75, 75, 75); // Token: 0x040000E6 RID: 230 private Color schemeMouseOver = Color.FromArgb(97, 97, 97); // Token: 0x040000E7 RID: 231 private Color schemeMouseDown = Color.Gray; // Token: 0x040000E8 RID: 232 private Color schemeCheckedColor = Color.DimGray; // Token: 0x040000E9 RID: 233 private Color schemeButtonColor = Color.FromArgb(87, 87, 87); // Token: 0x040000EA RID: 234 private string lastLoadedScheme = string.Empty; // Token: 0x0200000A RID: 10 public enum menuLocation { // Token: 0x040002D5 RID: 725 OverCaller, // Token: 0x040002D6 RID: 726 BellowCaller } // Token: 0x0200000B RID: 11 private enum itemType { // Token: 0x040002D8 RID: 728 Button, // Token: 0x040002D9 RID: 729 Label, // Token: 0x040002DA RID: 730 Divider, // Token: 0x040002DB RID: 731 TextBox } // Token: 0x0200000C RID: 12 public enum menuOffset { // Token: 0x040002DD RID: 733 Left, // Token: 0x040002DE RID: 734 Right } // Token: 0x0200000D RID: 13 public enum colorScheme { // Token: 0x040002E0 RID: 736 MainForm, // Token: 0x040002E1 RID: 737 FlyOut } // Token: 0x0200000E RID: 14 public enum menuWidth { // Token: 0x040002E3 RID: 739 Auto, // Token: 0x040002E4 RID: 740 CallerWidth } // Token: 0x0200000F RID: 15 public enum btnBarStates { // Token: 0x040002E6 RID: 742 StartUp, // Token: 0x040002E7 RID: 743 Login, // Token: 0x040002E8 RID: 744 UserLogin, // Token: 0x040002E9 RID: 745 Welcome, // Token: 0x040002EA RID: 746 ServerType, // Token: 0x040002EB RID: 747 Companies, // Token: 0x040002EC RID: 748 UserOptions, // Token: 0x040002ED RID: 749 UserDetails, // Token: 0x040002EE RID: 750 ConfFinal, // Token: 0x040002EF RID: 751 Information, // Token: 0x040002F0 RID: 752 MainMenu, // Token: 0x040002F1 RID: 753 ChangeCompany, // Token: 0x040002F2 RID: 754 Backup, // Token: 0x040002F3 RID: 755 ConfCompany } // Token: 0x02000010 RID: 16 public enum operationMode { // Token: 0x040002F5 RID: 757 Add, // Token: 0x040002F6 RID: 758 Edit, // Token: 0x040002F7 RID: 759 NA } // Token: 0x02000011 RID: 17 public enum selProgramOptions { // Token: 0x040002F9 RID: 761 PPOS, // Token: 0x040002FA RID: 762 Invoices, // Token: 0x040002FB RID: 763 Purchases, // Token: 0x040002FC RID: 764 NA } // Token: 0x02000012 RID: 18 public enum MessageReturn { // Token: 0x040002FE RID: 766 OK, // Token: 0x040002FF RID: 767 Cancel, // Token: 0x04000300 RID: 768 NA } // Token: 0x02000013 RID: 19 public enum MessageColor { // Token: 0x04000302 RID: 770 Green, // Token: 0x04000303 RID: 771 Blue, // Token: 0x04000304 RID: 772 Red } // Token: 0x02000014 RID: 20 private enum companyStatus { // Token: 0x04000306 RID: 774 Active, // Token: 0x04000307 RID: 775 InActive } // Token: 0x02000015 RID: 21 public enum licenceVal { // Token: 0x04000309 RID: 777 OK, // Token: 0x0400030A RID: 778 LicenceFileMissing, // Token: 0x0400030B RID: 779 NA } // Token: 0x02000016 RID: 22 public enum dbType { // Token: 0x0400030D RID: 781 local, // Token: 0x0400030E RID: 782 online } // Token: 0x02000017 RID: 23 public enum AfterAddingItemToGrid { // Token: 0x04000310 RID: 784 NewLine, // Token: 0x04000311 RID: 785 QtyColumn, // Token: 0x04000312 RID: 786 PriceColumn } // Token: 0x02000018 RID: 24 public enum NotificationColor { // Token: 0x04000314 RID: 788 Green, // Token: 0x04000315 RID: 789 Blue, // Token: 0x04000316 RID: 790 Red } // Token: 0x02000019 RID: 25 public enum schemeName { // Token: 0x04000318 RID: 792 Default, // Token: 0x04000319 RID: 793 Brown, // Token: 0x0400031A RID: 794 Blue, // Token: 0x0400031B RID: 795 Green, // Token: 0x0400031C RID: 796 Red, // Token: 0x0400031D RID: 797 Pink, // Token: 0x0400031E RID: 798 Bonsai, // Token: 0x0400031F RID: 799 Black } } }