private void AddRecord() { try { var ml = new Employee_ML() { EmpName = txtName.Value, EmpPhone = txtMobile.Value, EmpEmail = txtEmail.Value, EmpBranch = txtBranch.Value }; var result = new Employee_BL().AddEmployee(ml); if (result) { GetEmployees(); } } catch (Exception) { throw; } }
protected void btnUpdate_ServerClick(object sender, EventArgs e) { try { var ml = new Employee_ML() { EmpId = (Int32)gridEmployees.GetSelectedFieldValues("EmpId")[0], EmpName = txtName.Value, EmpPhone = txtMobile.Value, EmpEmail = txtEmail.Value, EmpBranch = txtBranch.Value }; var result = new Employee_BL().UpdateEmployee(ml); if (result) { GetEmployees(); } } catch (Exception) { throw; } }