Example #1
0
        public ActionResult EmployeeDetails(FormCollection fCollection)
        {
            objLoginHelper = (LoginHelper)Session["LogInInformation"];

            ViewBag.LocationTitle = objLoginHelper.LocationTitle;
            ViewBag.Location      = objLoginHelper.Location;
            ViewBag.ZoneTitle     = objLoginHelper.ZoneTitle;
            ViewBag.ZoneName      = objLoginHelper.LogInForZoneName;
            ViewBag.RegionTitle   = objLoginHelper.RegionTitle;
            ViewBag.RegionName    = objLoginHelper.LogInForRegionName;
            ViewBag.UnitTitle     = objLoginHelper.UnitTitle;
            ViewBag.UnitName      = objLoginHelper.LogInForUnitName;
            ViewBag.OpenMonthYear = "Month: " + objLoginHelper.MonthOpenForHRMS.ToString("MMMM-yy");
            ViewBag.ModuleName    = objLoginHelper.ModluleTitle;
            ViewBag.TopMenu       = objLoginHelper.TopMenu;
            ViewBag.CurrentDay    = objLoginHelper.MonthOpenForHRMS.Date.ToString("dd-MMM-yyyy");
            ViewBag.CalenderDate  = objLoginHelper.MonthOpenForHRMS;

            string EmployeeID = string.Empty;

            if (!string.IsNullOrEmpty(fCollection["hfSearchEmployeeId"]))
            {
                EmployeeID = fCollection["hfSearchEmployeeId"];

                ViewBag.EmployeeId       = "";
                ViewBag.EmployeeSearchId = fCollection["txtSearchEmployeeId"];
            }
            else
            {
                EmployeeID = Helper.EmployeeIdProcess(fCollection["txtEmployeeId"]);

                ViewBag.EmployeeId       = fCollection["txtEmployeeId"];
                ViewBag.EmployeeSearchId = "";
            }

            EmployeeDetails objEmployeeDetails = new EmployeeDetails();

            objEmployeeDetails = hrmsData.EmployeeDetailsInfo(EmployeeID);

            if (!System.IO.File.Exists(Path.Combine(Server.MapPath("~/" + Helper.EmployeeImagePath(objEmployeeDetails.EmployeeID)))))
            {
                objEmployeeDetails.EmployeeImagePath = "../../" + Helper.NoEmployeeImage;
            }

            if (!System.IO.File.Exists(Path.Combine(Server.MapPath("~/" + Helper.EmployeeSignaturePath(objEmployeeDetails.EmployeeID)))))
            {
                objEmployeeDetails.EmployeeSignaturePath = "../../" + Helper.NoEmployeeSignature;
            }

            return(View(objEmployeeDetails));
        }