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); } }
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 bool PerformValidation() { bool result = true; if (dto.Worker_detail.Where(x => x.Employee_Id == Convert.ToInt16(cbEmployee.SelectedValue.ToString())).ToList().Count > 0) { AddFunc.MsgError("Employee Already Added"); result = false; } return(result); }
private void updateToolStripMenuItem_Click(object sender, EventArgs e) { if (RowIndex > -1) { CopyBL2GUI(); _FormMode = FormMode.Update; } else { AddFunc.MsgError("No Row Selected!"); } }
private bool PerformValidation() { bool Result = true; string message; message = AddFunc.CheckControlTextBoxStringEmpty(txtNewPasswd, txtoldPasswd, txtRePasswd, txtUsername); if (message != string.Empty) { AddFunc.MsgError(message); Result = false; } return(Result); }
private bool PerformValidation() { bool Result = true; string message = AddFunc.CheckControlTextBoxStringEmpty(txtAlamat, txtBornDate, txtDescription, txtEmail, txtName, txtNoBatch); string messages = AddFunc.CheckComboBoxValue(LstDepartment, Position); if (message != string.Empty) { AddFunc.MsgError(message); Result = false; } return(Result); }
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 bool PerformValidation() { bool result = true; string message = AddFunc.CheckControlTextBoxStringEmpty(txtBPMobil, txtCustomer, txtMobil); if (message != string.Empty) { AddFunc.MsgError(message); result = false; } if (_obj.Invoice_Detail.Where(x => x.Service_Name == cbPackages.Text).Count() > 0) { AddFunc.MsgError("This Package Already Add !"); result = false; } return(result); }
private bool PerformValidation() { bool result = true; string message; message = AddFunc.CheckControlTextBoxStringEmpty(txtPackageNames); if (message != string.Empty) { AddFunc.MsgError(message); result = false; } message = AddFunc.CheckNumericZero(nmrPrice); if (message != string.Empty) { AddFunc.MsgError(message); result = false; } return(result); }
private void tvUserGroupRoles_AfterCheck(object sender, TreeViewEventArgs e) { try { if (e.Action != TreeViewAction.Unknown) { if (e.Node.Checked) { if (lboUser.Items.Count > 0) { usergrouproles = listusergrouproles.FirstOrDefault(x => x.MenuPath == e.Node.FullPath && x.UserId == lboUser.SelectedItem.ToString()); usergrouproles.ObjectState = usergrouproles.ObjectState == EntityState.None ? EntityState.Update : usergrouproles.ObjectState; usergrouproles.Permission = e.Node.Checked; if (e.Node.Parent != null) { usergrouproles = listusergrouproles.FirstOrDefault(x => x.MenuPath == e.Node.Parent.FullPath && x.UserId == lboUser.SelectedItem.ToString()); usergrouproles.ObjectState = usergrouproles.ObjectState == EntityState.None ? EntityState.Update : usergrouproles.ObjectState; usergrouproles.Permission = e.Node.Parent.Checked = e.Node.Checked; } } else { e.Node.Checked = false; MessageBox.Show("Please register a user for your selected user group !"); } } else { usergrouproles = listusergrouproles.FirstOrDefault(x => x.MenuPath == e.Node.FullPath && x.UserId == lboUser.SelectedItem.ToString()); usergrouproles.ObjectState = usergrouproles.ObjectState == EntityState.None ? EntityState.Update : usergrouproles.ObjectState; usergrouproles.Permission = false; AddRecursiveNode(e.Node, false, lboUser.SelectedItem.ToString()); } } } catch (Exception ex) { AddFunc.MsgError(ex.Message); } }
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 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); } }