public List <VHR_EmployeeProfile> GetSpecificEmployees(VMLoggedUser vmf)
        {
            List <VHR_EmployeeProfile> vmList = new List <VHR_EmployeeProfile>();

            if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.AllEmployees))
            {
                vmList = VHREmployeeProfileReporsitory.GetAll().Where(aa => aa.Status == "Active" && aa.CompanyID != 3).ToList();
            }
            else if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.LocationBased))
            {
                if (vmf.UserLoctions != null)
                {
                    foreach (var userLocaion in vmf.UserLoctions)
                    {
                        Expression <Func <VHR_EmployeeProfile, bool> > SpecificEntries = c => c.LocationID == userLocaion.LocationID;
                        vmList.AddRange(VHREmployeeProfileReporsitory.FindBy(SpecificEntries).Where(aa => aa.Status == "Active" && aa.CompanyID != 3).OrderBy(aa => aa.JobTitleID).ToList());
                    }
                }
            }
            else if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.Normal))
            {
                vmList = EmployeeLM.GetReportingEmployees(VHREmployeeProfileReporsitory.GetAll().Where(aa => aa.Status == "Active" && aa.CompanyID != 3).OrderBy(aa => aa.JobTitleID).ToList(), vmf);
            }
            return(vmList);
        }
Exemple #2
0
        //HISTORY FOR LM'S TO SEE WHOSE JOBCARD APPLICATION HE HAS APRROVED OR REJECTED
        public ActionResult JobCardHistoryIndex()
        {
            VMLoggedUser LoggedInUser          = Session["LoggedInUser"] as VMLoggedUser;
            List <VEP_JobCardApplication> list = JobCardESSPService.GetEmpJobCardHistory(LoggedInUser);

            return(View(list));
        }
        public ActionResult RosterContinue(VMRosterContinue vm)
        {
            VMLoggedUser  LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
            VMRosterModel vmRoster     = RosterService.ContinueRoster(vm);

            return(View("Create2", vmRoster));
        }
Exemple #4
0
        public ActionResult Detail(int?id)
        {
            VMLoggedUser        vmf = Session["LoggedInUser"] as VMLoggedUser;
            VMESSPJobCardDetail vMESSPJobCardDetail = JobCardESSPService.GetJobCardEmpDetail(id, vmf);

            return(View(vMESSPJobCardDetail));
        }
Exemple #5
0
        /// MAIN INDEX FOR MY JOBCARD

        public ActionResult Index(string searchString, string currentFilter, int?page)
        {
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            ViewBag.CurrentFilter = searchString;
            // Disable Notifications
            int notiTypeID1 = Convert.ToInt32(NotificationTypeJCEnum.JCApproved);
            int notiTypeID2 = Convert.ToInt32(NotificationTypeJCEnum.JCRejected);
            Expression <Func <Notification, bool> > SpecificEntries = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID1 || c.NotificationTypeID == notiTypeID2));

            DDService.DeleteNotification(SpecificEntries);
            List <VEP_JobCardApplication> jcapp = JobCardESSPService.GetIndex(LoggedInUser).OrderByDescending(aa => aa.PJobCardAppID).ToList();

            if (!String.IsNullOrEmpty(searchString))
            {
                jcapp = jcapp.Where(aa => aa.OEmpID.Contains(searchString) || aa.EmployeeName.ToUpper().Contains(searchString.ToUpper()) || aa.PJobCardAppID.ToString().Contains(searchString) || aa.EmployeeName.ToUpper().Contains(searchString.ToUpper()) || aa.JobCardName.ToString().Contains(searchString)).ToList();
            }
            int pageSize   = 500;
            int pageNumber = (page ?? 1);

            return(View(jcapp.ToPagedList(pageNumber, pageSize)));
        }
Exemple #6
0
        public void PostCreate(VMEmployee obj, VMLoggedUser LoggedInUser)
        {
            // Gets the single emoployee from the database
            Employee employeeObj = new Employee();

            employeeObj.OEmpID            = obj.OEmpID;
            employeeObj.EmployeeName      = obj.EmployeeName;
            employeeObj.FPID              = Convert.ToInt32(obj.OEmpID);
            employeeObj.ShiftID           = obj.ShiftID;
            employeeObj.CardNo            = obj.CardNo;
            employeeObj.JobTitleID        = null;
            employeeObj.GradeID           = 13;
            employeeObj.CompanyID         = 1;
            employeeObj.LocationID        = 211;
            employeeObj.OUID              = null;
            employeeObj.COUID             = null;
            employeeObj.DesigationID      = null;
            employeeObj.DateOfBirth       = obj.DateOfBirth;
            employeeObj.DOJ               = obj.DOJ;
            employeeObj.FatherName        = obj.FatherName;
            employeeObj.CNIC              = obj.CNIC;
            employeeObj.EmploymentTypeID  = null;
            employeeObj.CrewID            = obj.CrewID;
            employeeObj.Status            = "Active";
            employeeObj.Gender            = obj.Gender;
            employeeObj.CNIC              = obj.CNIC;
            employeeObj.ProcessAttendance = true;
            employeeObj.HasOneStep        = true;
            EmployeeRepository.Add(employeeObj);
            EmployeeRepository.Save();
            //UnitOfWork.Commit();
        }
        public ActionResult Edit(VMEmployee obj)
        {
            VMLoggedUser vmf = Session["LoggedInUser"] as VMLoggedUser;

            if (obj.LineManagerID == 0)
            {
                obj.LineManagerID = null;
            }
            if (obj.CardNo != null && obj.CardNo != "")
            {
                Expression <Func <Employee, bool> > SpecificEntries = c => c.CardNo == obj.CardNo && c.PEmployeeID != obj.PEmployeeID;
                if (EmpDBService.GetIndexSpecific(SpecificEntries).Count() > 0)
                {
                    ModelState.AddModelError("CardNo", "Duplicate Card Number");
                }
            }
            if (obj.OfficialEmail != null)
            {
                Match match = Regex.Match(obj.OfficialEmail, @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
                if (!match.Success)
                {
                    ModelState.AddModelError("OfficialEmail", "Invalid Email Address");
                }
            }
            if (ModelState.IsValid)
            {
                EmployeeService.PostEdit(obj, vmf);
                return(Json("OK", JsonRequestBehavior.AllowGet));
            }
            EditHelper(obj);
            return(PartialView("Edit", obj));
        }
        public List <VEP_JobCardApplication> GetEmpJobCardHistory(VMLoggedUser LoggedInUser)
        {
            //Gets the Job Card List for the Line Manager containing all the Job Cards that he has  Approved or Rejected.
            Expression <Func <VEP_JobCardApplication, bool> > SpecificEntries = c => (c.LineManagerID == LoggedInUser.PUserID && (c.JobCardStageID == "A" || c.JobCardStageID == "R"));

            return(VEPJobCardApplicationReporsitory.FindBy(SpecificEntries));
        }
Exemple #9
0
 public ActionResult Edit(Designation obj)
 {
     if (obj.Status == false)
     {
         Expression <Func <Employee, bool> > SpecificEntries = c => c.Status == "Active" && c.CrewID == obj.PDesignationID;
         if (EmployeeService.GetIndexSpecific(SpecificEntries).Count() > 0)
         {
             ModelState.AddModelError("Status", "You cannot Inactive due to attachment of active employees");
         }
     }
     if (obj.DesignationName == null || obj.DesignationName == "")
     {
         ModelState.AddModelError("DesignationName", "Crew name cannot be empty");
     }
     if (DesignationService.GetIndex().Where(aa => aa.DesignationName == obj.DesignationName && aa.PDesignationID != obj.PDesignationID).Count() > 0)
     {
         ModelState.AddModelError("DesignationName", "Crew name must be unique");
     }
     if (ModelState.IsValid)
     {
         DesignationService.PostEdit(obj);
         VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
         DDService.SaveAuditLog(LoggedInUser.PUserID, AuditFormAttendance.Positions, AuditTypeCommon.Edit, obj.PDesignationID, App_Start.AppAssistant.GetClientMachineInfo());
         return(Json("OK", JsonRequestBehavior.AllowGet));
     }
     HelperMethod(obj);
     return(PartialView("Edit", obj));
 }
        public VMESSPJobCardDetail GetJobCardEmpDetail(int?id, VMLoggedUser LoggedInUser)
        {    //Gets the Specific JobCard flow id
            Expression <Func <VAT_JobCardFlow, bool> > SpecificEntries = c => c.JobCardAppID == id;
            List <VAT_JobCardFlow> vatJobCardFlows = VATJobCardAppFlowReporsitory.FindBy(SpecificEntries);
            //Gets the Specific Jobcard Application id whose Detail is to shown.
            Expression <Func <VEP_JobCardApplication, bool> > SpecificEntries2 = c => c.PJobCardAppID == id;
            VEP_JobCardApplication dbVEP_JobCard = VEPJobCardApplicationReporsitory.FindBy(SpecificEntries2).First();
            //View Model of the Job card Application to show Specific job card's Data in the View.
            VMESSPJobCardDetail vmesspJobCardDetail = new VMESSPJobCardDetail();

            vmesspJobCardDetail.DBVATjobcardflow = vatJobCardFlows.ToList();
            vmesspJobCardDetail.EmployeeName     = dbVEP_JobCard.EmployeeName;
            vmesspJobCardDetail.DesignationName  = dbVEP_JobCard.DesignationName;
            vmesspJobCardDetail.JobCardName      = dbVEP_JobCard.JobCardName;
            vmesspJobCardDetail.JobCardStageName = dbVEP_JobCard.JobCardStageName;
            vmesspJobCardDetail.DateCreated      = dbVEP_JobCard.DateCreated;
            vmesspJobCardDetail.DateStarted      = dbVEP_JobCard.DateStarted;
            vmesspJobCardDetail.DateEnded        = dbVEP_JobCard.DateEnded;
            vmesspJobCardDetail.TimeEnd          = dbVEP_JobCard.TimeEnd;
            vmesspJobCardDetail.TimeStart        = dbVEP_JobCard.TimeStart;
            vmesspJobCardDetail.Minutes          = dbVEP_JobCard.Minutes;
            vmesspJobCardDetail.Remarks          = dbVEP_JobCard.Remarks;
            vmesspJobCardDetail.LMName           = LoggedInUser.LMEmployeeName;

            return(vmesspJobCardDetail);
        }
        public List <VEP_JobCardApplication> GetPendingJobCardRequests(VMLoggedUser LoggedInUser)
        {
            //Gets the list Job Card of the employee that are in Pending.
            Expression <Func <VEP_JobCardApplication, bool> > SpecificEntries = c => (c.LineManagerID == LoggedInUser.PUserID && c.JobCardStageID == "P");

            return(VEPJobCardApplicationReporsitory.FindBy(SpecificEntries));
        }
 public void PostCreate(JobCardApp obj, VMLoggedUser LoggedInUser)
 {
     try
     {
         //Save the value provided in the Get of Jobcard and save them in the Jobcard app Table.
         obj.DateCreated    = DateTime.Now;
         obj.JobCardStageID = "P";
         obj.LineManagerID  = LoggedInUser.LineManagerID;
         obj.Remarks        = obj.Remarks;
         obj.JobCardTypeID  = obj.JobCardTypeID;
         obj.DateStarted    = obj.DateStarted;
         obj.DateEnded      = obj.DateEnded;
         JobCardAppRepository.Add(obj);
         JobCardAppRepository.Save();
         // Add Notification to Line Manager that he has a Pending Job card request
         DDService.SaveNotification((int)obj.LineManagerID, "/ESSP/ESSPJobCard/PendingJobCardIndex",
                                    Convert.ToInt32(NotificationTypeJCEnum.JCPending), true, obj.EmployeeID, obj.PJobCardAppID);
         SaveJobCardFlow((int)obj.LineManagerID, (int)LoggedInUser.PUserID, obj.JobCardStageID, obj.PJobCardAppID, obj.Remarks, "");
         // Save entry in  Notification email about the Submission of leave application that is sent to LIne manager through the Service
         VHR_UserEmployee LMUser  = DDService.GetEmployeeUser(obj.LineManagerID, null);
         VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, obj.EmployeeID);
         Expression <Func <VAT_JobCardApplication, bool> > SpecificEntries = c => (c.PJobCardAppID == obj.PJobCardAppID);
         VAT_JobCardApplication dbVAT_JobCardApplication = VATJobCardApplicationReporsitory.FindBy(SpecificEntries).First();
         DDService.GenerateEmail(LMUser.OfficialEmailID, "", "Job Card Application # " + obj.PJobCardAppID.ToString(),
                                 ESSPText.GetPendingJCText(dbVAT_JobCardApplication, LMUser.UserEmployeeName), LoggedInUser.PUserID, Convert.ToInt32(NotificationTypeJCEnum.JCPending));
     }
     catch (Exception ex)
     {
     }
 }
        public void RejectJobCard(VMESSPCommon vmESSPCommon, VMLoggedUser LoggedInUser)
        {
            //Gets the First entry and comment box for the approval of the Job Card Application
            JobCardApp jobCardApp = JobCardAppRepository.GetSingle((int)vmESSPCommon.PID);

            //Changes the stage of JobCard to "R"(Rejected).
            jobCardApp.JobCardStageID = "R";
            JobCardAppRepository.Edit(jobCardApp);
            UnitOfWork.Commit();
            // Add notifcation to Employee end about the Rejection of the Job Card
            VHR_UserEmployee LMUser  = DDService.GetEmployeeUser(jobCardApp.LineManagerID, null);
            VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, jobCardApp.EmployeeID);

            DDService.SaveNotification((int)EmpUser.PUserID, "/ESSP/ESSPJobCard/Index",
                                       Convert.ToInt32(NotificationTypeJCEnum.JCRejected), true, jobCardApp.EmployeeID, jobCardApp.PJobCardAppID);
            // Create Entry in the Job card flow.
            SaveJobCardFlow(EmpUser.PUserID, LMUser.PUserID, jobCardApp.JobCardStageID, jobCardApp.PJobCardAppID, "", vmESSPCommon.Comment);
            // Save Email in notification email about the Rejection of the jobcard that is being sent to the employeee through Service.
            Expression <Func <VAT_JobCardApplication, bool> > SpecificEntries2 = c => (c.PJobCardAppID == jobCardApp.PJobCardAppID);
            VAT_JobCardApplication dbVAT_JobCardApplication = VATJobCardApplicationReporsitory.FindBy(SpecificEntries2).First();

            DDService.GenerateEmail(EmpUser.OfficialEmailID, "", "Job Card Application # " + jobCardApp.PJobCardAppID.ToString(),
                                    ESSPText.GetRejectJCText(dbVAT_JobCardApplication, EmpUser.UserEmployeeName, LMUser.UserEmployeeName, LMUser.DesignationName), LoggedInUser.PUserID, Convert.ToInt32(NotificationTypeJCEnum.JCRejected));
            // Disable Notifications of Pending Job Card
            int notiTypeID1 = Convert.ToInt32(NotificationTypeJCEnum.JCPending);
            Expression <Func <Notification, bool> > SpecificEntries = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID1) && c.PID == jobCardApp.PJobCardAppID);

            DDService.DeleteNotification(SpecificEntries);
        }
        public List <VAT_DailyAttendance> GetSpecificAbsentAttendance(VMLoggedUser vmf, DateTime dateFrom, DateTime DateTo)
        {
            List <VAT_DailyAttendance> vmList = new List <VAT_DailyAttendance>();

            if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.AllEmployees))
            {
                Expression <Func <VAT_DailyAttendance, bool> > SpecificEntries = c => c.AttDate >= dateFrom && c.AttDate <= DateTo && c.DutyCode == "D" && c.Status == "Active";
                vmList = VATDailyAttendance.FindBy(SpecificEntries);
            }
            else if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.LocationBased))
            {
                if (vmf.UserLoctions != null)
                {
                    foreach (var userLocaion in vmf.UserLoctions)
                    {
                        Expression <Func <VAT_DailyAttendance, bool> > SpecificEntries = c => c.LocationID == userLocaion.LocationID && c.AttDate >= dateFrom && c.AttDate <= DateTo && c.DutyCode == "D" && c.Status == "Active";
                        vmList.AddRange(VATDailyAttendance.FindBy(SpecificEntries));
                    }
                }
            }
            //else if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.Normal))
            //{
            //    vmList = EmployeeLM.GetReportingEmployees(VHREmployeeProfileReporsitory.GetAll(), vmf);
            //}
            return(vmList);
        }
        public void RevertToLMLeaveApplication(VMESSPCommon vmESSPCommon, VMLoggedUser LoggedInUser)
        {
            //gets the First entry and comment box for the approval of the leave application
            LeaveApplication lvapplication = LeaveApplicationRepository.GetSingle((int)vmESSPCommon.PID);

            //Changes Leave Stage ID to "A" (Approved).
            lvapplication.LeaveStageID  = "L";
            lvapplication.LineManagerID = (int)lvapplication.SubmittedByUserID;
            LeaveApplicationRepository.Edit(lvapplication);
            UnitOfWork.Commit();
            //Generated the Notification to the Employee about the rejection of the leave application.
            VHR_UserEmployee LMUser  = DDService.GetEmployeeUser(lvapplication.LineManagerID, null);
            VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, lvapplication.EmpID);

            DDService.SaveNotification((int)lvapplication.LineManagerID, "/ESSP/ESSPLeaveApp/PendingLeaveApplicationIndex",
                                       Convert.ToInt32(NTLeaveEnum.LeaveReverttoLM), true, LMUser.UserEmpID, lvapplication.PLeaveAppID);
            SaveLeaveApplicationFlow((int)LMUser.PUserID, (int)LoggedInUser.PUserID, lvapplication.LeaveStageID, lvapplication.PLeaveAppID, "", vmESSPCommon.Comment);
            //Generate Email to the employee that leave is Rejected.
            Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries3 = c => c.PLeaveAppID == lvapplication.PLeaveAppID;
            VAT_LeaveApplication vlvApplication = VEPESSPLeaveApplicationReporsitory.FindBy(SpecificEntries3).First();

            DDService.GenerateEmail(EmpUser.OfficialEmailID, "", "Leave Application # " + lvapplication.PLeaveAppID.ToString(),
                                    ESSPText.GetRejectLeaveText(vlvApplication, EmpUser.UserEmployeeName, LMUser.UserEmployeeName, LMUser.DesignationName), LoggedInUser.PUserID, Convert.ToInt32(NTLeaveEnum.LeaveRejected));
            // Disable Notification ofPending Leave from the Line Manager's End.
            int notiTypeID1 = Convert.ToInt32(NTLeaveEnum.LeaveRecommend);
            Expression <Func <Notification, bool> > SpecificEntries = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID1) && c.PID == lvapplication.PLeaveAppID);

            DDService.DeleteNotification(SpecificEntries);
        }
Exemple #16
0
        public ActionResult Login(AppUser Obj)
        {
            Session["VMATDashboard"] = "";
            //string EncryptedPassword = App_Start.AppAssistant.Encrypt(Obj.Password);
            Expression <Func <VHR_AppUser, bool> > SpecificEntries1 = aa => aa.UserName == Obj.UserName && aa.Password == Obj.Password && aa.UserStatus == true;

            if (VHRAppUserService.GetIndexSpecific(SpecificEntries1).Count() > 0)
            {
                VHR_AppUser vm = VHRAppUserService.GetIndexSpecific(SpecificEntries1).First();
                Expression <Func <AppUserLocation, bool> > SpecificEntries = c => c.UserID == vm.PUserID;

                VMLoggedUser vmLoggedUser = GetLoggedInUser(vm, AppUserLocationService.GetIndexSpecific(SpecificEntries));
                Session["LoggedInUser"] = vmLoggedUser;
                //DDService.SaveAuditLog(vm.PUserID, AuditFormAttendance.Home, AuditTypeCommon.LogIN, 0, App_Start.AppAssistant.GetClientMachineInfo());
                if (vm.UserRoleID == "U")
                {
                    return(RedirectToAction("TimeOfficeDashboard", "AttendanceDashboard"));
                }
                else
                {
                    return(RedirectToAction("MainContainer", "AttendanceDashboard"));
                }
            }
            else
            {
                ModelState.AddModelError("Password", "The username or password is incorrect");
                return(View("Login", Obj));
            }
        }
 public void CreateLeave(LeaveApplication lvapplication, LeaveType lvType, VMLoggedUser LoggedInUser)
 {
     try
     {
         //gets the information of leave and saving entries from logged in user to leaveApplication.
         lvapplication.LeaveDate = DateTime.Today;
         int _userID = (int)LoggedInUser.PUserID;
         lvapplication.LineManagerID     = (int)LoggedInUser.LineManagerID;
         lvapplication.CreatedBy         = _userID;
         lvapplication.Active            = true;
         lvapplication.LeaveStageID      = "P";
         lvapplication.SubmittedByUserID = LoggedInUser.PUserID;
         LeaveApplicationRepository.Add(lvapplication);
         LeaveApplicationRepository.Save();
         // Add notification to Line manager's end that he has a pending leave Request.
         DDService.SaveNotification(lvapplication.LineManagerID, "/ESSP/ESSPLeaveApp/PendingLeaveApplicationIndex",
                                    Convert.ToInt32(NTLeaveEnum.LeavePending), true, lvapplication.EmpID, lvapplication.PLeaveAppID);
         SaveLeaveApplicationFlow(lvapplication.LineManagerID, _userID, lvapplication.LeaveStageID, lvapplication.PLeaveAppID, lvapplication.LeaveReason, "");
         // Save entry in Notification Email table for where the email is generated through service.
         VHR_UserEmployee LMUser  = DDService.GetEmployeeUser(lvapplication.LineManagerID, null);
         VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, lvapplication.EmpID);
         Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries2 = c => c.PLeaveAppID == lvapplication.PLeaveAppID;
         VAT_LeaveApplication vlvApplication = VEPESSPLeaveApplicationReporsitory.FindBy(SpecificEntries2).First();
         DDService.GenerateEmail(LMUser.OfficialEmailID, "", "Leave Application # " + lvapplication.PLeaveAppID.ToString(),
                                 ESSPText.GetPendingLeaveText(vlvApplication, LMUser.UserEmployeeName), LoggedInUser.PUserID, Convert.ToInt32(NTLeaveEnum.LeavePending));
     }
     catch (Exception ex)
     {
     }
 }
        public ActionResult Index()
        {
            VMLoggedUser     LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
            List <VAT_Shift> list         = DDService.GetShift(LoggedInUser);

            return(View(list));
        }
        public ActionResult LoadNotificationEmployee(string Criteria)
        {
            VMLoggedUser vmf = Session["LoggedInUser"] as VMLoggedUser;
            List <VHR_EmployeeProfile> vmList = new List <VHR_EmployeeProfile>();

            vmList = EmployeeService.GetIndex(vmf);
            switch (Criteria)
            {
            case "Shift":
                vmList = vmList.Where(aa => aa.ShiftID == null).ToList();
                break;

            case "LM":
                vmList = vmList.Where(aa => aa.LMUserName == null && aa.Status == "Active").ToList();
                break;

            case "Crew":
                vmList = vmList.Where(aa => aa.CrewID == null).ToList();
                break;

            case "FPID":
                vmList = vmList.Where(aa => aa.FPID == null).ToList();
                break;
            }
            return(View("Index", vmList));
        }
        // Dashboard
        #region Dashboard Links
        public ActionResult LoadTMDashboardAttendance(DateTime?date, string Criteria)
        {
            VMLoggedUser             LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
            VMEditAttendanceDateWise vm           = DailyAttendanceEditorService.GetTMDashboardAttendance((DateTime)date, Criteria, GetSpecificEmployeeService.GetSpecificAttendance(LoggedInUser, (DateTime)date));

            return(View("EditDateWiseEntries", vm));
        }
        public ActionResult Create4(VMOvertimeApproval vmOvertimeApproval, int?[] SelectedEmpIds)
        {
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
            List <VMOvertimeApprovalChild> vmOvertimeApprovalChildEntries = new List <VMOvertimeApprovalChild>();

            foreach (var empID in SelectedEmpIds)
            {
                VMOvertimeApprovalChild vmOvertimeApprovalChild = new VMOvertimeApprovalChild();
                string EncashableSingleOT = Request.Form["ENCS-" + empID.Value.ToString()].ToString();
                string EncashableDoubleOT = Request.Form["ENCD-" + empID.Value.ToString()].ToString();
                //string AbsentDays = Request.Form["ABDays-" + empID.Value.ToString()].ToString();
                //string CPLHours = Request.Form["CPLH-" + empID.Value.ToString()].ToString();
                string CPLHours = "0";
                vmOvertimeApprovalChild.EmpID = (int)empID;
                vmOvertimeApprovalChild.EncashableSingleOT = Convert.ToInt32(EncashableSingleOT);
                vmOvertimeApprovalChild.EncashableDoubleOT = Convert.ToInt32(EncashableDoubleOT);
                vmOvertimeApprovalChild.CPLConvertedOT     = Convert.ToInt32(CPLHours);
                //vmOvertimeApprovalChild.Absents = Convert.ToInt32(AbsentDays);
                vmOvertimeApprovalChildEntries.Add(vmOvertimeApprovalChild);
            }
            vmOvertimeApproval.OvertimeApprovalChild = vmOvertimeApprovalChildEntries.ToList();
            VMOvertimeApproval vm = OvertimeAprrovalService.GetCreate4(vmOvertimeApproval, LoggedInUser);

            //if (vm.ErrorMessages.Count == 0)
            return(RedirectToAction("Index"));
            //else
            //    return View("Create3", vm);
        }
Exemple #22
0
        public ActionResult Detail(int?id)
        {
            VMLoggedUser       vmf = Session["LoggedInUser"] as VMLoggedUser;
            VMESSPLeaveDetails vMESSPLeaveDetail = ESSPLeaveService.GetESSPLeaveEmpDetail(id, vmf);

            return(View(vMESSPLeaveDetail));
        }
Exemple #23
0
        private void SingleDayJobCardHelper(JobCardApp obj)
        {
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            ViewBag.EmpNo         = LoggedInUser.OEmpID;
            ViewBag.JobCardTypeID = new SelectList(DDService.GetJobCardType().ToList().Where(aa => aa.PJobCardTypeID != 1 && aa.PJobCardTypeID != 3 && aa.PJobCardTypeID != 4).ToList(), "PJobCardTypeID", "JobCardName", obj.JobCardTypeID);
        }
        public ActionResult SendEmailToLM()
        {
            // Send email to LM
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
            Expression <Func <VHR_UserEmployee, bool> > SpecificEntries2 = aa => aa.UserStatus == true;
            List <VHR_UserEmployee> dbUsers = VHR_UserEmployeeService.GetIndexSpecific(SpecificEntries2).ToList();
            // For Leaves
            List <VAT_LeaveApplication> dbLVApplications = new List <VAT_LeaveApplication>();

            if (LoggedInUser.UserAccessTypeID == 2)
            {
                if (LoggedInUser.UserLoctions != null)
                {
                    foreach (var userLocaion in LoggedInUser.UserLoctions)
                    {
                        Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries23 = aa => aa.LeaveStageID == "P" && aa.LocationID == userLocaion.LocationID;
                        dbLVApplications.AddRange(VATLeaveApplicationService.GetIndexSpecific(SpecificEntries23).ToList());
                    }
                }
            }
            foreach (var LineManagerID in dbLVApplications.Select(aa => aa.LineManagerID).Distinct().ToList())
            {
                if (dbUsers.Where(aa => aa.PUserID == LineManagerID).Count() > 0)
                {
                    VHR_UserEmployee vHR_UserEmployee = dbUsers.First(aa => aa.PUserID == LineManagerID);
                    if (vHR_UserEmployee.OfficialEmailID != "" && vHR_UserEmployee.OfficialEmailID != null)
                    {
                        // Send email
                        DDService.GenerateEmail(vHR_UserEmployee.OfficialEmailID, "", "Payroll Period is Closing: Need your attention", ESSPText.GetPendingLeaveAlertEmail(vHR_UserEmployee.UserEmployeeName), LoggedInUser.PUserID, Convert.ToInt32(NTLeaveEnum.EmailAlert));
                    }
                }
            }
            return(RedirectToAction("ESSPPendingLeaveIndex"));
        }
Exemple #25
0
        //FOR LM TO APPROVE OR REJECT JOBCARDS
        public ActionResult PendingJobCardIndex()
        {
            VMLoggedUser LoggedInUser          = Session["LoggedInUser"] as VMLoggedUser;
            List <VEP_JobCardApplication> list = JobCardESSPService.GetPendingJobCardRequests(LoggedInUser).OrderByDescending(aa => aa.PJobCardAppID).ToList();

            return(View(list));
        }
        private void HelperMethod(LeaveApplication obj)
        {
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            ViewBag.LeaveTypeID     = new SelectList(DDService.GetLeaveType().ToList().OrderBy(aa => aa.LeaveTypeName).ToList(), "PLeaveTypeID", "LeaveTypeName");
            ViewBag.FinancialYearID = new SelectList(DDService.GetFinancialYear().Where(aa => aa.FYStatus == true).ToList().OrderByDescending(aa => aa.PFinancialYearID).ToList(), "PFinancialYearID", "FYName");
        }
        public List <VMLeaveQuotaChild> GetIndex(int FinancialYearID, VMLoggedUser LoggedInUser)
        {
            List <VMLeaveQuotaChild>   vmLeaveQuotaChildList          = new List <VMLeaveQuotaChild>();
            List <VHR_EmployeeProfile> employees                      = DDService.GetEmployeeInfo(LoggedInUser);           // Get All Employees from database
            Expression <Func <LeaveQuotaYear, bool> > SpecificEntries = c => c.FinancialYearID == FinancialYearID;
            List <LeaveQuotaYear> leaveQuotaYearList                  = LeaveQuotaYearReporsitory.FindBy(SpecificEntries); // Get all Leave quota Balances for specific financial year

            foreach (var item in employees)
            {
                if (leaveQuotaYearList.Where(aa => aa.EmployeeID == item.PEmployeeID).Count() > 0)
                {
                    VMLeaveQuotaChild vmLeaveQuotaChild = new VMLeaveQuotaChild();
                    vmLeaveQuotaChild.EmpID        = item.PEmployeeID;
                    vmLeaveQuotaChild.EmpNo        = item.OEmpID;
                    vmLeaveQuotaChild.EmployeeName = item.EmployeeName;
                    vmLeaveQuotaChild.AL           = GetRemainingLeaveBalance(leaveQuotaYearList.Where(aa => aa.EmployeeID == item.PEmployeeID && aa.LeaveTypeID == 1).ToList());
                    vmLeaveQuotaChild.CL           = GetRemainingLeaveBalance(leaveQuotaYearList.Where(aa => aa.EmployeeID == item.PEmployeeID && aa.LeaveTypeID == 2).ToList());
                    vmLeaveQuotaChild.SL           = GetRemainingLeaveBalance(leaveQuotaYearList.Where(aa => aa.EmployeeID == item.PEmployeeID && aa.LeaveTypeID == 3).ToList());
                    vmLeaveQuotaChild.STDL         = GetRemainingLeaveBalance(leaveQuotaYearList.Where(aa => aa.EmployeeID == item.PEmployeeID && aa.LeaveTypeID == 4).ToList());
                    vmLeaveQuotaChild.ACCL         = GetRemainingACCLeaveBalance(leaveQuotaYearList.Where(aa => aa.EmployeeID == item.PEmployeeID && aa.LeaveTypeID == 1).ToList());
                    vmLeaveQuotaChild.JobTitleName = item.JobTitleName;
                    vmLeaveQuotaChildList.Add(vmLeaveQuotaChild);
                }
            }
            return(vmLeaveQuotaChildList);
        }
        public ActionResult Index(string searchString, string currentFilter, int?page)
        {
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            ViewBag.CurrentFilter = searchString;
            List <VAT_LeaveApplication> dbVAT_LeaveApplications = new List <VAT_LeaveApplication>();

            try
            {
                VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

                if (LoggedInUser.UserAccessTypeID == 2)
                {
                    if (LoggedInUser.UserLoctions != null)
                    {
                        // Get all leave application based on User locations
                        foreach (var userLocaion in LoggedInUser.UserLoctions)
                        {
                            Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries = c => c.LocationID == userLocaion.LocationID && (c.LeaveStageID == "A" || c.LeaveStageID == null);
                            dbVAT_LeaveApplications.AddRange(VATLeaveApplicationService.GetIndexSpecific(SpecificEntries).OrderByDescending(aa => aa.PLeaveAppID).ToList());
                        }
                    }
                }
                if (LoggedInUser.UserAccessTypeID == 4)
                {
                    if (LoggedInUser.UserDepartments != null)
                    {
                        // Get all leave application based on User locations
                        foreach (var userDepartment in LoggedInUser.UserDepartments)
                        {
                            Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries = c => c.OUCommonID == userDepartment.DepartmentID && (c.LeaveStageID == "A" || c.LeaveStageID == null);
                            dbVAT_LeaveApplications.AddRange(VATLeaveApplicationService.GetIndexSpecific(SpecificEntries).OrderByDescending(aa => aa.PLeaveAppID).ToList());
                        }
                    }
                }
                else
                {
                    // Get all approved leave applications in case of admin location user
                    Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries = c => (c.LeaveStageID == "A" || c.LeaveStageID == null);
                    dbVAT_LeaveApplications = VATLeaveApplicationService.GetIndexSpecific(SpecificEntries).OrderByDescending(aa => aa.LeaveDate).ToList();
                }
            }
            catch (Exception ex)
            {
            }
            if (!String.IsNullOrEmpty(searchString))
            {
                dbVAT_LeaveApplications = dbVAT_LeaveApplications.Where(aa => aa.OEmpID.Contains(searchString) || aa.EmployeeName.ToUpper().Contains(searchString.ToUpper()) || aa.PLeaveAppID.ToString().Contains(searchString)).ToList();
            }
            int pageSize   = 15;
            int pageNumber = (page ?? 1);

            return(View(dbVAT_LeaveApplications.ToPagedList(pageNumber, pageSize)));
        }
        public ActionResult OpenEmployeeRoster(int ShiftID, int CrewID)

        {
            Expression <Func <VAT_RosterApplication, bool> > SpecificEntries1 = c => c.CriteriaData == CrewID;
            var rosterApps = VATRosterApplicationService.GetIndexSpecific(SpecificEntries1);
            Expression <Func <RosterApplication, bool> > SpecificEntries2 = c => c.CriteriaData == CrewID;
            var rosterApps2 = RosterApplicationService.GetIndexSpecific(SpecificEntries2);

            if (rosterApps.Count > 0)
            {
                VAT_RosterApplication rosterApp = rosterApps.First();
                Expression <Func <RosterDetail, bool> > SpecificEntries = c => c.RosterAppID == rosterApp.RotaAppID;
                var rosterdetails = RosterDetailService.GetIndexSpecific(SpecificEntries);

                ViewBag.Header = "For Shift: " + rosterApp.ShiftName + ", Group: " + rosterApp.CrewName;
                return(View("RosterDetail", CalculateRosterDetails(rosterdetails, rosterApps2.First()).OrderByDescending(aa => aa.DutyDate)));
            }
            else
            {
                Shift        obj          = ShiftService.GetEdit((int)ShiftID);
                VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;
                ViewBag.LocationID = new SelectList(DDService.GetLocation(LoggedInUser).ToList().OrderBy(aa => aa.LocationName).ToList(), "PLocationID", "LocationName", obj.LocationID);
                ViewBag.DayOff1    = new SelectList(DDService.GetDaysName().ToList().OrderBy(aa => aa.DayName).ToList(), "DaysNameID", "DayName", obj.DayOff1);
                ViewBag.DayOff2    = new SelectList(DDService.GetDaysName().ToList().OrderBy(aa => aa.DayName).ToList(), "DaysNameID", "DayName", obj.DayOff2);
                return(View("ShiftView", obj));
            }
        }
        public List <VAT_DailyOvertime> GetSpecificDailyOT(VMLoggedUser vmf)
        {
            List <VAT_DailyOvertime> vmList = new List <VAT_DailyOvertime>();

            if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.AllEmployees))
            {
                //Expression<Func<VAT_DailyOvertime, bool>> SpecificEntries = c => c.AttDate == date;
                //vmList = VATDailyAttendance.FindBy(SpecificEntries);
                vmList = VATDailyOvertime.GetAll();
            }
            else if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.LocationBased))
            {
                if (vmf.UserLoctions != null)
                {
                    foreach (var userLocaion in vmf.UserLoctions)
                    {
                        Expression <Func <VAT_DailyOvertime, bool> > SpecificEntries = c => c.LocationID == userLocaion.LocationID;
                        vmList.AddRange(VATDailyOvertime.FindBy(SpecificEntries));
                    }
                }
            }
            //else if (vmf.UserAccessTypeID == Convert.ToInt32(UserAccessType.Normal))
            //{
            //    vmList = EmployeeLM.GetReportingEmployees(VHREmployeeProfileReporsitory.GetAll(), vmf);
            //}
            return(vmList);
        }