public ActionResult LeaveBalance(int?Id)
        {
            if (Id == null)
            {
                Id = Convert.ToInt32(Session["EmpCode"]);
            }
            else
            {
                ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(Convert.ToInt32(Id));
            }

            try
            {
                LeaveBalanceModel result = new LeaveBalanceModel();
                result.LeaveBalance             = _LeaveAddAdmin.LeaveBalanceSearch();
                result.LeaveBalance.EmpCodeList = _LeaveEarnedService.GetBrancheEmployeeSelectList(Convert.ToInt32(Session["EmpCode"]));
                if (Id >= 0)
                {
                    result.LeaveBalance.EmpCode = Convert.ToInt32(Id);
                }
                else
                {
                    result.LeaveBalance.EmpCode = Convert.ToInt32(Session["EmpCode"]);
                }
                result.LeaveBalanceDetails = _LeaveAddAdmin.LeaveBalanceList(result.LeaveBalance.LeaveYearId, Convert.ToInt32(result.LeaveBalance.EmpCode));
                return(View(result));
            }
            catch (Exception Ex)
            {
                Session["error"] = Ex.Message;
                return(View());
            }
        }
Beispiel #2
0
 public ActionResult LeaveBalance()
 {
     try
     {
         LeaveBalanceModel result = new LeaveBalanceModel();
         result.LeaveBalance         = _LeaveAddAdmin.LeaveBalanceSearch();
         result.LeaveBalance.EmpCode = Convert.ToInt32(Session["EmpCode"]);
         result.LeaveBalanceDetails  = _LeaveAddAdmin.LeaveBalanceList(result.LeaveBalance.LeaveYearId, Convert.ToInt32(result.LeaveBalance.EmpCode));
         return(View(result));
     }
     catch (Exception Ex)
     {
         Session["error"] = Ex.Message;
         return(View());
     }
 }