public LogIn() { try { controller = new Controller(); InitializeComponent(); } catch (Exception e2) { MessageBox.Show(Utility.ExceptionResult(e2), "Error"); } }
public Form1(string spNr, string name, Controller controller, Boolean Admin) { try { InitializeComponent(); this.controller = controller; this.spNr = spNr; this.ClearAllErrorMessages(); FillProductTable(); if (Admin) { tabControl.Enabled = true; lblLoggedInAs.Text = "Logged in as : " + name + " (Admin)"; FillProductTableAdmin(); FillProductTableNotForSaleAdmin(); FillNotWorkingSalesPersonTable(); FillWorkingSalesPersonTable(); FillEmployeeComboBox(); FillDataGridViewHistory1AllSalesPersons(); } else { tabControl.Controls.Remove(tabPageEmployee); tabControl.Controls.Remove(tabPageProduct); tabControl.Controls.Remove(tabPageHistory); tabControl.Controls.Remove(tabPageStatistics); exitToolStripMenuItem.Enabled = false; lblLoggedInAs.Text = "Logged in as: " + name; exitToolStripMenuItem.Enabled = false; } this.spNr = spNr; // GÖR SÅ ATT KOMMA BLIR PUNKT ISTÄLLET! (viktigt för att det ska gå att lägga in i sql) /LUDDE System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; System.Threading.Thread.CurrentThread.CurrentCulture = customCulture; // textBoxNumPad.Text = totalPrice.ToString(); btnViewSale.Visible = false; } catch (Exception e2) { MessageBox.Show(Utility.ExceptionResult(e2), "Error"); } }