public UserTsManager GetDetailLevel(int levelTs) { UserTsManager result = _contextTsics.UserTsManager .FirstOrDefault(t => t.LevelTs == levelTs); return(result); }
// GET: Account public ActionResult Index() { ViewBag.Download = WebConfigure.GetDomain() + "/Upload/Document/" + WebConfigure.GetUserGuideNameFileWithExtention(); if (Session["userid"] == null) { return(RedirectToAction("Login", "Account")); } else { //if (Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower()) //{ // return RedirectToAction("Login", "Account"); //} var userT = _userBService.GetDetail(Convert.ToInt32(Session["userid"])); ViewBag.MsgReject = _userMessageBService.GetListByEmployeeId(userT.EmployeeId); User app1 = userT.Approval1 == 0 ? null : _userBService.GetDetailByEmployeeId(userT.Approval1); User app2 = userT.Approval2 == 0 ? null : _userBService.GetDetailByEmployeeId(userT.Approval2); EmployeeMaster userEmpMst = _mstEmployeeBService.GetDetailbyUserName(userT.Username); EmployeeMaster empMstApp1 = userEmpMst == null ? null : _mstEmployeeBService.GetDetail(userEmpMst.Superior_ID); EmployeeMaster empMstApp2 = empMstApp1 == null ? null : _mstEmployeeBService.GetDetail(empMstApp1.Superior_ID); ViewBag.App1 = app1 == null ? null : app1; ViewBag.App2 = app2 == null ? null : app2; ViewBag.empMstApp1 = empMstApp1 == null ? null : empMstApp1; ViewBag.empMstApp2 = empMstApp2 == null ? null : empMstApp2; UserTsManager tsmanager = userT.UserTsManager1Id == 0 ? null : _userTsManagerBusinessService.GetDetail(userT.UserTsManager1Id); ViewBag.TSManager = tsmanager == null ? null : _userBService.GetDetailByEmployeeId(tsmanager.EmployeeId); ViewBag.Recent = _ticketBs.GetRecent(); var Employemst = _mstEmployeeBService.GetDetail(userT.EmployeeId); if (Employemst == null) { ViewBag.EmployeeMaster_empId = String.Empty; ViewBag.EmployeeMaster_POH_Id = String.Empty; ViewBag.EmployeeMaster_POH_Name = "-"; } else { ViewBag.EmployeeMaster_empId = Convert.ToString(Employemst.Employee_Id); ViewBag.EmployeeMaster_POH_Id = string.IsNullOrWhiteSpace(Employemst.Business_Area) ? "-" : "ID : " + Employemst.Business_Area; ViewBag.EmployeeMaster_POH_Name = string.IsNullOrWhiteSpace(Employemst.Business_Area_Desc) ? "-" : Employemst.Business_Area_Desc; } return(View(userT)); } }
public UserTsManager GetDetail(int id) { UserTsManager userTs = _contextTsics.UserTsManager.Find(id); return(userTs); }