Exemplo n.º 1
0
 public ActionResult userone()
 {
     dynamic data = new System.Dynamic.ExpandoObject();
     int id = WebRequest.GetInt("id", 0);
     string type = WebRequest.GetString("type");
     EmployeeModel model = new EmployeeModel();
     if (id > 0 && type == "edit")
     {
         model = systemService.GetEmployeeList("").FirstOrDefault(p => p.staffId == id);
     }
     else type = "add";
     var roles = systemService.GetRoleList("").
         Select(p => new SelectListItem { Text = p.roleName, Value = p.roleSn.ToString() }).ToList();
     data.roles = roles;
     data.id = id;
     data.type = type;
     data.model = model;
     return View(data);
 }
Exemplo n.º 2
0
 public ActionResult employeeone()
 {
     dynamic data = new System.Dynamic.ExpandoObject();
     int id = WebRequest.GetInt("id", 0);
     string type = WebRequest.GetString("type");
     EmployeeModel model = new EmployeeModel();
     if (id > 0 && type == "edit")
     {
         model = manageService.GetEmployeeList("").FirstOrDefault(p => p.staffId == id);
     }
     else type = "add";
     var deplist = manageService.GetDepartmentList("").
         Where(p => p.valid == true).
         Select(p => new SelectListItem { Text = p.depName, Value = p.depId.ToString() }).ToList();
     data.deplist = deplist;
     data.id = id;
     data.type = type;
     data.model = model;
     return View(data);
 }