public ActionResult CommentView(string FormName, int?PID) { VMESSPCommon vmEsspCommon = new VMESSPCommon(); vmEsspCommon.FormName = FormName; vmEsspCommon.PID = PID; if (vmEsspCommon.FormName == "JobCard") { ViewBag.StageID = new SelectList(DDService.GetJobCardStage().ToList().Where(aa => aa.PJobCardStageID != "P").ToList(), "PJobCardStageID", "JobCardStageName", "A"); } else { Expression <Func <VAT_LeaveApplication, bool> > SpecificEntries97 = c => c.PLeaveAppID == PID; VAT_LeaveApplication vatLeaveApplication = VATLeaveApplicationService.GetIndexSpecific(SpecificEntries97).First(); // Leave Stage D is for recomendation if (vatLeaveApplication.LeaveStageID == "D") { // Leave Stage L is for revert to LM ViewBag.StageID = new SelectList(DDService.GetLeaveStage().ToList().Where(aa => aa.PLeaveStageID == "L").OrderByDescending(aa => aa.PLeaveStageID).ToList(), "PLeaveStageID", "LeaveStageName", "L"); } // Leave Stage R is for Rejected else if (vatLeaveApplication.LeaveStageID == "P") { ViewBag.StageID = new SelectList(DDService.GetLeaveStage().ToList().Where(aa => aa.PLeaveStageID == "R").OrderByDescending(aa => aa.PLeaveStageID).ToList(), "PLeaveStageID", "LeaveStageName", "R"); } else if (vatLeaveApplication.LeaveStageID == "L") { ViewBag.StageID = new SelectList(DDService.GetLeaveStage().ToList().Where(aa => aa.PLeaveStageID == "R").OrderByDescending(aa => aa.PLeaveStageID).ToList(), "PLeaveStageID", "LeaveStageName", "R"); } } return(View()); }
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); }
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 string ApproveLeaveApplication(VMESSPCommon vmESSPCommon, VMLoggedUser LoggedInUser, string Message) { //gets the First entry and comment box for the approval of the leave application LeaveApplication lvapplication = LeaveApplicationRepository.GetSingle((int)vmESSPCommon.PID); //if (DDService.IsDateLieBetweenActivePayroll(lvapplication.FromDate)) //{ //Gets Employee Information about the access of the location and company of the employee. List <VHR_EmployeeProfile> _emp = DDService.GetEmployeeInfo(LoggedInUser).Where(aa => aa.PEmployeeID == lvapplication.EmpID).ToList(); VHR_EmployeeProfile employee = DDService.GetEmployeeInfo(LoggedInUser).Where(aa => aa.PEmployeeID == lvapplication.EmpID).First(); //Gets Employee Leave policy on the Type of leave applied LeavePolicy lvPolicy = AssistantLeave.GetEmployeeLeavePolicyID(_emp, lvapplication.LeaveTypeID, DDService.GetLeavePolicy().ToList()); Expression <Func <PayrollPeriod, bool> > SpecificEntries96 = c => lvapplication.FromDate >= c.PRStartDate && lvapplication.FromDate <= c.PREndDate && c.PeriodStageID == "C"; List <PayrollPeriod> dbPayrollPeriods = PayrollPeriodService.GetIndexSpecific(SpecificEntries96).ToList(); if (dbPayrollPeriods.Count() > 0) { Message = "Cannot Approve leaves of Closed Payroll Period"; } if (Message == "") { //Check the Leave balance if there are some leaves remaining of the employee whose leave is being approved. if (LeaveApplicationService.CheckLeaveBalance(lvapplication, lvPolicy)) { //Changes Leave Stage ID to "A" (Approved). lvapplication.LeaveStageID = "A"; //Gets the leave Type through generic service. LeaveType lvType = DDService.GetLeaveType().First(aa => aa.PLeaveTypeID == lvapplication.LeaveTypeID); LeaveApplicationService.BalanceLeaves(lvapplication, lvType, AssistantLeave.GetPayRollPeriodID(DDService.GetPayrollPeriod().ToList(), lvapplication.FromDate)); LeaveApplicationRepository.Edit(lvapplication); LeaveApplicationRepository.Save(); UnitOfWork.Commit(); //Adds leave to leave data frim where its impact is generated on the reports. LeaveApplicationService.AddLeaveToLeaveData(lvapplication, lvType, lvPolicy); //Add Leaves to Att Data where Daily and Monthy Reporcessing of attendance occurs on the day LeaveApplicationService.AddLeaveToAttData(lvapplication, lvType); VHR_UserEmployee LMUser = DDService.GetEmployeeUser(lvapplication.LineManagerID, null); VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, lvapplication.EmpID); // Add notification to the Employee that leave has been approved. DDService.SaveNotification((int)EmpUser.PUserID, "/ESSP/ESSPLeaveApp/Index", Convert.ToInt32(NTLeaveEnum.LeaveApproved), true, lvapplication.LineManagerID, lvapplication.PLeaveAppID); //Add entry in the flow table SaveLeaveApplicationFlow((int)EmpUser.PUserID, lvapplication.LineManagerID, lvapplication.LeaveStageID, lvapplication.PLeaveAppID, "", vmESSPCommon.Comment); //Save Email in the Notification Email table from where through services email is generated to employee about the approval of the leave Application. 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.GetApprovedLeaveText(vlvApplication, EmpUser.UserEmployeeName, LMUser.UserEmployeeName, LMUser.DesignationName), LoggedInUser.PUserID, Convert.ToInt32(NTLeaveEnum.LeaveApproved)); // Disable Notification of the pending Leave. int notiTypeID1 = Convert.ToInt32(NTLeaveEnum.LeavePending); Expression <Func <Notification, bool> > SpecificEntries = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID1) && c.PID == lvapplication.PLeaveAppID); DDService.DeleteNotification(SpecificEntries); } } return(Message); }
public ActionResult CommentView(string FormName, int?PID) { VMESSPCommon vmEsspCommon = new VMESSPCommon(); vmEsspCommon.FormName = FormName; vmEsspCommon.PID = PID; if (vmEsspCommon.FormName == "JobCard") { ViewBag.StageID = new SelectList(DDService.GetJobCardStage().ToList().Where(aa => aa.PJobCardStageID != "P").ToList(), "PJobCardStageID", "JobCardStageName", "A"); } else { ViewBag.StageID = new SelectList(DDService.GetLeaveStage().ToList().Where(aa => aa.PLeaveStageID != "P" && aa.PLeaveStageID != "A").OrderByDescending(aa => aa.PLeaveStageID).ToList(), "PLeaveStageID", "LeaveStageName", "A"); } return(View()); }
public ActionResult CommentView(VMESSPCommon vmESSPCommon) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; // Save Entry in Flow\ string Message = ""; switch (vmESSPCommon.FormName) { case "JobCard": if (vmESSPCommon.StageID == "A") { Message = JobCardESSPService.ApproveJobCard(vmESSPCommon, LoggedInUser, Message); ToasterMessages.Add("Job Card successfully Approved !"); Session["ToasterMessages"] = ToasterMessages; } else { JobCardESSPService.RejectJobCard(vmESSPCommon, LoggedInUser); ToasterMessages.Add("Job card Rejected successfully !"); Session["ToasterMessages"] = ToasterMessages; } break; case "Leave": if (vmESSPCommon.StageID == "D") { LeaveApplicationESSPService.RecommendLeaveApplication(vmESSPCommon, LoggedInUser, Message); ToasterMessages.Add("Leave successfully Approved !"); Session["ToasterMessages"] = ToasterMessages; } else if (vmESSPCommon.StageID == "R") { LeaveApplicationESSPService.RejectLeaveApplication(vmESSPCommon, LoggedInUser); ToasterMessages.Add("Leave Rejected successfully !"); Session["ToasterMessages"] = ToasterMessages; } else if (vmESSPCommon.StageID == "L") { LeaveApplicationESSPService.RevertToLMLeaveApplication(vmESSPCommon, LoggedInUser); ToasterMessages.Add("Leave Reverted successfully !"); Session["ToasterMessages"] = ToasterMessages; } break; } return(Json("OK", JsonRequestBehavior.AllowGet)); }
public string ApproveJobCard(VMESSPCommon vmESSPCommon, VMLoggedUser LoggedInUser, string Message) { //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 "A"(Approved). //if (DDService.IsDateLieBetweenActivePayroll(jobCardApp.DateStarted)) //{ Expression <Func <PayrollPeriod, bool> > SpecificEntries96 = c => jobCardApp.DateStarted >= c.PRStartDate && jobCardApp.DateStarted <= c.PREndDate && c.PeriodStageID == "C"; List <PayrollPeriod> dbPayrollPeriods = PayrollPeriodService.GetIndexSpecific(SpecificEntries96).ToList(); if (dbPayrollPeriods.Count() > 0) { Message = "Cannot Approve Job Cards of Closed Payroll Period"; } if (Message == "") { jobCardApp.JobCardStageID = "A"; JobCardAppRepository.Edit(jobCardApp); UnitOfWork.Commit(); //Gets the LM and Employee Information VHR_UserEmployee LMUser = DDService.GetEmployeeUser(jobCardApp.LineManagerID, null); VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, jobCardApp.EmployeeID); // Add notifcation to Employee end about the Approval of the Job Card DDService.SaveNotification((int)EmpUser.PUserID, "/ESSP/ESSPJobCard/Index", Convert.ToInt32(NotificationTypeJCEnum.JCApproved), true, jobCardApp.LineManagerID, jobCardApp.PJobCardAppID); // Create Entry in the Job card flow. SaveJobCardFlow((int)EmpUser.PUserID, (int)jobCardApp.LineManagerID, jobCardApp.JobCardStageID, jobCardApp.PJobCardAppID, "", vmESSPCommon.Comment); // Save Email in notification email about the approval 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.GetApprovedJCText(dbVAT_JobCardApplication, EmpUser.UserEmployeeName, LMUser.UserEmployeeName, LMUser.DesignationName), LoggedInUser.PUserID, Convert.ToInt32(NotificationTypeJCEnum.JCApproved)); // Create Reprocess Request DDService.ProcessDailyAttendance(jobCardApp.DateStarted, jobCardApp.DateEnded, (int)jobCardApp.EmployeeID, jobCardApp.EmployeeID.ToString()); DDService.ProcessMonthlyAttendance(jobCardApp.DateStarted, (int)jobCardApp.EmployeeID, jobCardApp.EmployeeID.ToString()); // 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); } return(Message); }
public ActionResult ApprovedAll(int?[] SelectedJcAppIds) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; string Message = ""; foreach (var item in SelectedJcAppIds) { VMESSPCommon vmESSPCommon = new VMESSPCommon(); vmESSPCommon.PID = item; vmESSPCommon.Comment = ""; Message = JobCardESSPService.ApproveJobCard(vmESSPCommon, LoggedInUser, Message); } if (Message != "") { ToasterMessages.Add(Message); Session["ToasterMessages"] = ToasterMessages; } return(RedirectToAction("PendingJobCardIndex")); }
public ActionResult RecommendAll(int?[] SelectedLvAppIds) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; string Message = ""; foreach (var item in SelectedLvAppIds) { VMESSPCommon vmESSPCommon = new VMESSPCommon(); vmESSPCommon.PID = item; vmESSPCommon.Comment = ""; Message = ESSPLeaveService.RecommendLeaveApplication(vmESSPCommon, LoggedInUser, Message); } if (Message != "") { ToasterMessages.Add(Message); Session["ToasterMessages"] = ToasterMessages; } return(RedirectToAction("PendingLeaveApplicationIndex")); }
public void ApprovalCode(VMESSPCommon vmESSPCommon, VMLoggedUser LoggedInUser, LeaveApplication lvapplication, LeavePolicy lvPolicy) { if (LeaveApplicationService.CheckLeaveBalance(lvapplication, lvPolicy)) { //Changes Leave Stage ID to "A" (Approved). lvapplication.LeaveStageID = "A"; //Gets the leave Type through generic service. LeaveType lvType = DDService.GetLeaveType().First(aa => aa.PLeaveTypeID == lvapplication.LeaveTypeID); LeaveApplicationService.BalanceLeaves(lvapplication, lvType, AssistantLeave.GetPayRollPeriodID(DDService.GetPayrollPeriod().ToList(), lvapplication.FromDate)); LeaveApplicationRepository.Edit(lvapplication); LeaveApplicationRepository.Save(); UnitOfWork.Commit(); //Adds leave to leave data frim where its impact is generated on the reports. LeaveApplicationService.AddLeaveToLeaveData(lvapplication, lvType, lvPolicy); //Add Leaves to Att Data where Daily and Monthy Reporcessing of attendance occurs on the day LeaveApplicationService.AddLeaveToAttData(lvapplication, lvType); VHR_UserEmployee LMUser = DDService.GetEmployeeUser(lvapplication.LineManagerID, null); VHR_UserEmployee EmpUser = DDService.GetEmployeeUser(null, lvapplication.EmpID); // Add notification to the Employee that leave has been approved. DDService.SaveNotification((int)EmpUser.PUserID, "/ESSP/ESSPLeaveApp/Index", Convert.ToInt32(NTLeaveEnum.LeaveApproved), true, lvapplication.LineManagerID, lvapplication.PLeaveAppID); //Add entry in the flow table SaveLeaveApplicationFlow((int)EmpUser.PUserID, lvapplication.LineManagerID, lvapplication.LeaveStageID, lvapplication.PLeaveAppID, "", vmESSPCommon.Comment); //Save Email in the Notification Email table from where through services email is generated to employee about the approval of the leave Application. 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.GetApprovedLeaveText(vlvApplication, EmpUser.UserEmployeeName, LMUser.UserEmployeeName, LMUser.DesignationName), LoggedInUser.PUserID, Convert.ToInt32(NTLeaveEnum.LeaveApproved)); // Disable Notification of the pending Leave. int notiTypeID1 = Convert.ToInt32(NTLeaveEnum.LeavePending); Expression <Func <Notification, bool> > SpecificEntries = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID1) && c.PID == lvapplication.PLeaveAppID); DDService.DeleteNotification(SpecificEntries); // Disable Notification of the pending Leave. int notiTypeID2 = Convert.ToInt32(NTLeaveEnum.LeaveRecommend); Expression <Func <Notification, bool> > SpecificEntries2 = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID2) && c.PID == lvapplication.PLeaveAppID); DDService.DeleteNotification(SpecificEntries2); } }
public string RecommendLeaveApplication(VMESSPCommon vmESSPCommon, VMLoggedUser LoggedInUser, string Message) { //gets the First entry and comment box for the approval of the leave application LeaveApplication lvapplication = LeaveApplicationRepository.GetSingle((int)vmESSPCommon.PID); //if (DDService.IsDateLieBetweenActivePayroll(lvapplication.FromDate)) //{ //Gets Employee Information about the access of the location and company of the employee. List <VHR_EmployeeProfile> _emp = DDService.GetEmployeeInfo(LoggedInUser).Where(aa => aa.PEmployeeID == lvapplication.EmpID).ToList(); VHR_EmployeeProfile employee = DDService.GetEmployeeInfo(LoggedInUser).Where(aa => aa.PEmployeeID == lvapplication.EmpID).First(); //Gets Employee Leave policy on the Type of leave applied LeavePolicy lvPolicy = AssistantLeave.GetEmployeeLeavePolicyID(_emp, lvapplication.LeaveTypeID, DDService.GetLeavePolicy().ToList()); Expression <Func <PayrollPeriod, bool> > SpecificEntries96 = c => lvapplication.FromDate >= c.PRStartDate && lvapplication.FromDate <= c.PREndDate && c.PeriodStageID == "C"; List <PayrollPeriod> dbPayrollPeriods = PayrollPeriodService.GetIndexSpecific(SpecificEntries96).ToList(); if (dbPayrollPeriods.Count() > 0) { Message = "Cannot Approve leaves of Closed Payroll Period"; } if (Message == "") { if (employee.HasOneStep == false) { if (LoggedInUser.LineManagerID == null && (lvapplication.LeaveStageID == "P" || lvapplication.LeaveStageID == "D")) { ApprovalCode(vmESSPCommon, LoggedInUser, lvapplication, lvPolicy); } else if (LoggedInUser.LineManagerID != null && (lvapplication.LeaveStageID == "P")) { //gets the information of leave and saving entries from logged in user to leaveApplication. int _userID = (int)LoggedInUser.PUserID; lvapplication.LineManagerID = (int)LoggedInUser.LineManagerID; lvapplication.SubmittedByUserID = LoggedInUser.PUserID; lvapplication.LeaveStageID = "D"; LeaveApplicationRepository.Edit(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.LeaveRecommend), 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)); // Disable Notification of the pending Leave. int notiTypeID1 = Convert.ToInt32(NTLeaveEnum.LeavePending); Expression <Func <Notification, bool> > SpecificEntries = c => (c.UserID == LoggedInUser.PUserID && c.Status == true && (c.NotificationTypeID == notiTypeID1) && c.PID == lvapplication.PLeaveAppID); DDService.DeleteNotification(SpecificEntries); } else if (LoggedInUser.LineManagerID != null && (lvapplication.LeaveStageID == "D")) { ApprovalCode(vmESSPCommon, LoggedInUser, lvapplication, lvPolicy); } } else { if (lvapplication.LeaveStageID == "P") { ApprovalCode(vmESSPCommon, LoggedInUser, lvapplication, lvPolicy); } } } return(Message); }