private void button1_Click(object sender, EventArgs e) { try { if (!(txtName.Text.Equals("") || txtPrice.Equals("") || txtQuantity.Equals(""))) { String name = txtName.Text; int qty = Convert.ToInt32(txtQuantity.Text); decimal price = Convert.ToDecimal(txtPrice.Text); if (!(price.Equals(0) || qty.Equals(0))) { MainMenuAdmin.addnewItemtoList(name, price, qty); this.Dispose(); } else { MessageBox.Show("Enter values above 0 for items"); } } else { MessageBox.Show("Entered values are invalid"); } } catch (Exception err) { MessageBox.Show("Something went wrong. \n Check entered date"); //Console.WriteLine("UIL Error in AddNewItem.button1_Click: "+err.ToString()); logger.Error("\n UI Error in AddNewItem.button1_Click: " + err.ToString()); } }
public seleteBillProduct(MainMenuAdmin main, int catType, int itmType) { InitializeComponent(); this.MainMenuAdmin = main; this.catType = catType; this.itmType = itmType; }
private void button1_Click(object sender, EventArgs e) { String userName = ((txtUsrname.Text).Clone().ToString()).Replace(" ", string.Empty); String password = (txtPwrd.Text).Clone().ToString(); Console.WriteLine("Login"); if (userName == "" && password == "") { usernameVerifyMessage.Show(); passwordVerifyMessage.Show(); hideLabels(); } else if (userName == "") { usernameVerifyMessage.Show(); hideLabels(); } else if (password == "") { passwordVerifyMessage.Show(); hideLabels(); } else { user User = new user(userName, "", password, null, null, null, null, null); userDataManipulations userDataManipulations = new userDataManipulations(); Boolean userValidity = userDataManipulations.authenticateUser(User); if (userValidity) { wrapperDataBuffer.WrapperObject.Flag = 0; MainMenuAdmin newMainMenuAdmin = new MainMenuAdmin(); newMainMenuAdmin.Show(); this.Hide(); } else { loginVerifyMessage.Show(); hideLabels(); } } }
private void button1_Click(object sender, EventArgs e) { String userName = ((txtUsrname.Text).Clone().ToString()).Replace(" ", string.Empty); String password = (txtPwrd.Text).Clone().ToString(); if (userName == "" && password == "") { usernameVerifyMessage.Show(); passwordVerifyMessage.Show(); hideLabels(); } else if (userName == "") { usernameVerifyMessage.Show(); hideLabels(); } else if (password == "") { passwordVerifyMessage.Show(); hideLabels(); } else { user User = new user(userName, -1, password, null, null, null, null, null); userDataManipulations userDataManipulations = new userDataManipulations(); Boolean userValidity = userDataManipulations.authenticateUser(User); if (userValidity) { wrapperDataBuffer.WrapperObject.Flag = 0; MainMenuAdmin newMainMenuAdmin = new MainMenuAdmin(); newMainMenuAdmin.Show(); this.Hide(); } else { loginVerifyMessage.Show(); hideLabels(); } } }