protected void btnSave_Click(object sender, EventArgs e) { string msg = ""; BLLEmployee objbllEmployee = new BLLEmployee(); ATTEmployee objEmployee = new ATTEmployee(); objEmployee.EmpID = int.Parse(txtEmpID.Text.ToString()); objEmployee.EmpName = TextBox0.Text; objEmployee.EmpEmail = TextBox1.Text; objEmployee.EmpAddress = TextBox2.Text; objEmployee.EmpPhone = TextBox3.Text; if (lblAction.Text == "E") { objEmployee.Action = "E"; } else { objEmployee.Action = "A"; } msg = objbllEmployee.SaveEmployee(objEmployee); lblmsg.Text = msg; txtEmpID.Text = ""; TextBox0.Text = ""; TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; lblmsg.Text = ""; lblAction.Text = ""; lblStatusMessage.Text = ""; }
protected void loadEmployeeDetail() { BLLEmployee objbllRelType = new BLLEmployee();; GridView1.DataSource = objbllRelType.GetEmployee(1); GridView1.DataBind(); }
public object GetEmployeeDetails(string EmployeeId) { JsonResponse response = new JsonResponse(); BLLEmployee bllEmployee = new BLLEmployee(); response = bllEmployee.GetEmployeeDetails(EmployeeId); return(JsonUtility.Serialize(response)); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { string msg = ""; Object key = GridView1.DataKeys[e.RowIndex].Value; BLLEmployee objbllEmployee = new BLLEmployee(); msg = objbllEmployee.DeleteEmployee(int.Parse(key.ToString())); lblmsg.Text = msg; }
public object SaveEmployee(string args) { JsonResponse response = new JsonResponse(); ATTEmployee objATT = JsonUtility.DeSerialize(args, typeof(ATTEmployee)) as ATTEmployee; BLLEmployee bllObj = new BLLEmployee(); response = bllObj.SaveEmployee(objATT); return(JsonUtility.Serialize(response)); }
public void SaveEmployee_Add_ShouldReturnInteger() { // Arrange int expected = 1; // Act int actual = BLLEmployee.InsertEmployee("Jash", 27, 35000); // Assert Assert.AreEqual(expected, actual); }
// DELETE api/employee/5 public bool Delete(int id) { try { return(BLLEmployee.Delete(id)); } catch (Exception ex) { return(false); } }
// GET api/employee/5 public BOEmployee Get(int id) { try { return(BLLEmployee.GetEmployee(id)); } catch (Exception) { return(new BOEmployee()); } }
// GET api/employee public List <BOEmployee> Get() { try { return(BLLEmployee.GetAllEmployees()); } catch (Exception ex) { return(new BOEmployeeList()); } }
// GET api/employeedetails public BOEmployeeList Get() { try { return(BLLEmployee.GetEmployeeDetails()); } catch (Exception) { return(new BOEmployeeList()); } }
// GET api/employeedetails/5 public BOEmployee Get(int id) { try { var dd = BLLEmployee.GetEmployeeDetailsByID(id); return(dd); } catch (Exception ex) { return(new BOEmployee()); } }
// POST api/employee public string Post([FromBody] BOEmployee employeeDetails) { try { //TODO : needto veryfy insert and update int id = employeeDetails != null ? employeeDetails.EmployeeID : 0; int ret = BLLEmployee.Save(employeeDetails, id > 0 ? false : true); return(ret > 0 ? "Record saved successfully" : "There is a problem while saving record"); } catch (Exception ex) { return(ex.Message); } }
// POST api/checklogin public BOEmployee Post([FromBody] CheckLogin userDetail) { try { if (userDetail == null) { return(new BOEmployee()); } return(BLLEmployee.CheckLogin(userDetail.UserName, userDetail.Password)); } catch (Exception ex) { return(new BOEmployee()); } }
public void SaveEmployee(object sender, EventArgs e) { string Name = txtName.Text.Trim(); int Age = Convert.ToInt32(txtAge.Text); int Salary = Convert.ToInt32(txtSalary.Text); int result = BLLEmployee.InsertEmployee(Name, Age, Salary); if (result > 0) { lblMessage.Text = "Employee details Inserted Successfully"; } else if (result == -1) { lblMessage.Text = "Employee Age should not be less then 20 !"; } else { lblMessage.Text = "Employee details not Inserted"; } }