public void btnSave_Click(object sender, EventArgs e) { try { if (PerformValidation()) { CopyGUI2BL(); if (_FormMode == FormMode.New) { Employee.AddEmployee(_obj); AddFunc.MsgInfo("Data Add Succesful!"); } else if (_FormMode == FormMode.Update) { _obj.Id = Convert.ToInt16(dgResult.Rows[RowIndex].Cells["Id"].Value.ToString()); Employee.EditEmployee(_obj); AddFunc.MsgInfo("Data Edit Succesful!"); } RefresDG(); } } catch (Exception ex) { AddFunc.MsgError(ex.Message); } }
private void btnsubmit_Click(object sender, EventArgs e) { try { if (PerformValidation()) { if (txtNewPasswd.Text != txtRePasswd.Text) { AddFunc.MsgError("Password does not match !"); } else { if (txtoldPasswd.Text == txtNewPasswd.Text) { AddFunc.MsgError("New password can not be same old password !"); } else { CWUser.ChangePasswordCWUser(txtUsername.Text, txtNewPasswd.Text, txtoldPasswd.Text); AddFunc.MsgInfo("Change Password Succesfull"); } } } } catch (Exception ex) { AddFunc.MsgError(ex.Message); } }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (AddFunc.MsgQuesYESNO("Are you sure want to delete this record ?")) { Packages.DeletePackages(dgResult.Rows[RowIndex].Cells["Id"].Value.ToString()); AddFunc.MsgInfo("Data Delete Succesfull"); } RefreshDG(); }
private void ShowLogin() { FrmLogin form = new FrmLogin(); DialogResult dr = form.ShowDialog(); if (dr != DialogResult.OK) { this.Close(); } else { AddFunc.MsgInfo("Login Succesfull"); } }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (RowIndex > -1) { if (AddFunc.MsgQuesYESNO("Are sure want to delete this record ?")) { Employee.DeleteEmployee(dgResult.Rows[RowIndex].Cells["Id"].Value.ToString()); AddFunc.MsgInfo("Data Delete Succesful"); RefresDG(); } } else { AddFunc.MsgError("No Row Detected!"); } }
private void btnProcess_Click(object sender, EventArgs e) { try { if (dgResult.Rows.Count > 0) { if (AddFunc.MsgQuesYESNO("Are you sure want to process this invoices ?")) { _obj.CustomerName = txtCustomer.Text; Invoices.AddInvoice(_obj); AddFunc.MsgInfo("Thank For You Order"); } } else { AddFunc.MsgError("No Package added !"); } } catch (Exception ex) { AddFunc.MsgError(ex.Message); } }
private void btnAdd_Click(object sender, EventArgs e) { try { if (PerfomValidation()) { if (_form == FormMode.New) { CopyGUI2BL(); CWUser.AddCWUser(obj); AddFunc.MsgInfo("Add User Succesfull"); } else if (_form == FormMode.Update) { } _form = FormMode.View; SetupFormMode(); } }catch (Exception ex) { AddFunc.MsgError(ex.Message); } }
private void RefreshDG() { var source = new BindingSource(); source.DataSource = _obj.Invoice_Detail; dgResult.DataSource = source; dgResult = AddFunc.HideSpecificColoum(dgResult, "ID", "INVOICE_ID"); dgResult.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; Amount = _obj.Invoice_Detail.Sum(item => item.Price); if (Amount > 1000000) { _obj.Discount = Amount * 10 / 100; Amount = Amount * 90 / 100; AddFunc.MsgInfo("You Got a discount"); } else { _obj.Discount = 0; Amount = _obj.Invoice_Detail.Sum(item => item.Price); } lblPrice.Text = Amount.ToString(); Dto = new Invoice_DetailDTO(); }
private void btnAdd_Click(object sender, EventArgs e) { try { if (PerformValidation()) { if (_FormMode == FormMode.New) { Packages.AddPackages(txtPackageNames.Text, nmrPrice.Value); AddFunc.MsgInfo("Packages Add Succesful"); } else if (_FormMode == FormMode.Update) { Packages.EditPackages(Id, txtPackageNames.Text, nmrPrice.Value); AddFunc.MsgInfo("Packages Edit Succesful"); _FormMode = FormMode.New; } RefreshDG(); } } catch (Exception ex) { AddFunc.MsgError(ex.Message); } }