public JsonResult GetLocations() { string ret = null; if (Session["Ctx"] != null) { return(Json(JsonConvert.SerializeObject(LocationModel.GetAllLocations(Session["Ctx"] as Ctx)), JsonRequestBehavior.AllowGet)); } return(Json(new { ret }, JsonRequestBehavior.AllowGet)); }
public UpdateEmployeeViewModel(UpdateEmployeeView updateEmployeeOpen, Employee updateEmployee) { employee = updateEmployee; updateEmployeeView = updateEmployeeOpen; LocationList = locModel.GetAllLocations(); SectorList = secModel.GetAllSectors(); EmployeeList = empModel.GetAllEmployees(); location = updateEmployee.Location; sector = updateEmployee.Sector; bw.DoWork += DoWork; bw.RunWorkerCompleted += WorkCompleted; }
public AddEmployeeViewModel(AddEmployeeView addEmployeeOpen) { employee = new Employee(); location = new Location(); sector = new Sector(); addEmployeeView = addEmployeeOpen; LocationList = locModel.GetAllLocations(); SectorList = secModel.GetAllSectors(); EmployeeList = empModel.GetAllEmployees(); bw.DoWork += DoWork; bw.RunWorkerCompleted += WorkCompleted; }