public PartialViewResult GetBranchInfo(string branchName) { try { List <SalaryFixationEntity> lstSalaryFixation = DAFacade.GetSalaryFixationList(string.Format("PostingPlace='{0}'", branchName)); return(PartialView("_BranchInfo", lstSalaryFixation)); } catch (Exception) { throw; } }
public PartialViewResult GetIndividualSalaryFixationInfo(string empCode) { try { string currentUserBranchCode = string.Empty; if (HttpContext.User.Identity.Name.ToLower() == "admin") { currentUserBranchCode = "admin"; } else { ApplicationDbContext _ctx = new ApplicationDbContext(); ApplicationUser branchCode = _ctx.Users.Where(u => u.UserName == HttpContext.User.Identity.Name).FirstOrDefault(); currentUserBranchCode = branchCode.BranchCode; } List <SalaryFixationEntity> lstSalaryFixation = DAFacade.GetSalaryFixationList(string.Format("EmpCode='{0}' and BranchCode = case when '{1}' = 'admin' then BranchCode else '{1}' end", empCode, currentUserBranchCode)); return(PartialView("_IndividualSalaryFixationInfo", lstSalaryFixation)); } catch (Exception) { throw; } }