protected void BtnSave_Click(object sender, EventArgs e) { EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); EmployeeService.Employee employee = new EmployeeService.Employee(); employee.Id = Convert.ToInt32(TxtEmployeeID.Text); employee.Name = TxtEmployeeName.Text.ToString(); employee.DateOfBirth = Convert.ToDateTime(TxtEmployeeDateOfBirth.Text); client.SetEmployee(employee); }
protected void Button2_Click(object sender, EventArgs e) { EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); EmployeeService.Employee employee = new EmployeeService.Employee(); employee.Id = Convert.ToInt32(TextBox1.Text); employee.Name = TextBox5.Text; employee.Gender = TextBox3.Text; employee.DateOfBirth = Convert.ToDateTime(TextBox4.Text); client.SaveEmployee(employee); Label1.Text = "Employee saved!"; }
// GET: Employee/Create public ActionResult Add(Employee em) { EmployeeService.Employee e = new EmployeeService.Employee(); e.empId = em.empId; e.empName = em.empName; e.empMail = em.empMail; e.empPhone = em.empPhone; emp.AddEmp(e); ViewBag.Message = String.Format("Employee " + e.empId + " created successully"); return(RedirectToAction("Index", "Employee")); }
public ActionResult Edit(Employee em) { EmployeeService.Employee e = new EmployeeService.Employee(); e.empId = em.empId; e.empName = em.empName; e.empMail = em.empMail; e.empPhone = em.empPhone; int r = emp.UpdateEmp(e); if (r > 0) { ViewBag.Message = String.Format("Employee " + e.empId + " Updated successfully"); return(RedirectToAction("Index", "Employee")); } ViewBag.Message = String.Format("Employee " + e.empId + " was not updated"); return(View()); }
public System.Threading.Tasks.Task <string> CreateEmployeeAsync(EmployeeService.Employee e) { return(base.Channel.CreateEmployeeAsync(e)); }
public string CreateEmployee(EmployeeService.Employee e) { return(base.Channel.CreateEmployee(e)); }