public ActionResult Create(ServicePoxry.AWServiceReference.Employee employee) { if (this.ModelState.IsValid) { this.serviceClient.CreateEmployee(employee); return(this.RedirectToAction("Index")); } int count = 0; var employeelist = this.serviceClient.FindEmployeeByTitle(out count, null, 1, 10); var contactlist = this.serviceClient.GetPagedListContact(out count, 1, 10); this.ViewBag.ContactID = new SelectList(contactlist, "ContactID", "FirstName"); this.ViewBag.ManagerID = new SelectList(employeelist, "EmployeeID", "LoginID", employee.ManagerID); return(View(employee)); }
public ActionResult Edit(ServicePoxry.AWServiceReference.Employee employee) { if (this.ModelState.IsValid) { // db.Entry(employee).State = EntityState.Modified; // db.SaveChanges(); this.serviceClient.UpdateEmployee(employee); return(this.RedirectToAction("Index")); } int count = 0; PagedListOfEmployeeuTvS1Dbc employeelist = this.serviceClient.FindEmployeeByTitle(out count, null, 1, 10); var contactlist = this.serviceClient.GetPagedListContact(out count, 1, 10); this.ViewBag.ContactID = new SelectList(contactlist, "ContactID", "FirstName"); this.ViewBag.ManagerID = new SelectList(employeelist, "EmployeeID", "LoginID", employee.ManagerID); return(View(employee)); }