예제 #1
0
        private void SaveMaintenanceRequestStatus()
        {
            if (_presenter.CurrentMaintenanceRequest.Id <= 0)
            {
                if (_presenter.GetApprovalSettingforMaintenanceProcess(RequestType.Maintenance_Request.ToString().Replace('_', ' '), 0) != null)
                {
                    int i = 1;
                    foreach (ApprovalLevel AL in _presenter.GetApprovalSettingforMaintenanceProcess(RequestType.Maintenance_Request.ToString().Replace('_', ' '), 0).ApprovalLevels)
                    {
                        MaintenanceRequestStatus PRS = new MaintenanceRequestStatus();
                        PRS.MaintenanceRequest = _presenter.CurrentMaintenanceRequest;
                        if (AL.EmployeePosition.PositionName == "Superviser/Line Manager")
                        {
                            if (_presenter.CurrentUser().Superviser.Value != 0)
                            {
                                PRS.Approver = _presenter.CurrentUser().Superviser.Value;
                            }
                            else
                            {
                                PRS.ApprovalStatus = ApprovalStatus.Approved.ToString();
                                PRS.Date           = DateTime.Today.Date;
                            }
                        }
                        else if (AL.EmployeePosition.PositionName == "Program Manager")
                        {
                            if (_presenter.CurrentMaintenanceRequest.Project.Id != 0)
                            {
                                PRS.Approver = _presenter.GetProject(_presenter.CurrentMaintenanceRequest.Project.Id).AppUser.Id;
                            }
                        }
                        else
                        {
                            if (_presenter.Approver(AL.EmployeePosition.Id).Id != 0)
                            {
                                PRS.Approver = _presenter.Approver(AL.EmployeePosition.Id).Id;
                            }
                            else
                            {
                                PRS.Approver = 0;
                            }
                        }

                        //else
                        //{
                        //    PRS.Approver = _presenter.Approver(AL.EmployeePosition.Id).Id;
                        //}
                        PRS.WorkflowLevel = i;
                        i++;
                        _presenter.CurrentMaintenanceRequest.MaintenanceRequestStatuses.Add(PRS);
                    }
                }
                else
                {
                    pnlWarning.Visible = true;
                }
            }
        }
 private void SendEmail(MaintenanceRequestStatus MRS)
 {
     if (_presenter.GetUser(MRS.Approver).IsAssignedJob != true)
     {
         EmailSender.Send(_presenter.GetUser(MRS.Approver).Email, "Maintenance Request", (_presenter.GetUser(_presenter.CurrentMaintenanceRequest.AppUser.Id).FullName).ToUpper() + " Requests for Maintenance Request No. - '" + (_presenter.CurrentMaintenanceRequest.RequestNo).ToUpper() + "'");
     }
     else
     {
         EmailSender.Send(_presenter.GetUser(_presenter.GetAssignedJobbycurrentuser(MRS.Approver).AssignedTo).Email, "Maintenance Request", (_presenter.GetUser(_presenter.CurrentMaintenanceRequest.AppUser.Id).FullName).ToUpper() + " Requests for Maintenance with  Request No. - '" + (_presenter.CurrentMaintenanceRequest.RequestNo).ToUpper() + "'");
     }
 }
예제 #3
0
 private void SendEmail(MaintenanceRequestStatus VRS)
 {
     if (GetSuperviser(VRS.Approver).IsAssignedJob != true)
     {
         EmailSender.Send(GetSuperviser(VRS.Approver).Email, "Car Maintenance Request", (CurrentMaintenanceRequest.AppUser.FullName).ToUpper() + " Requests for Car Maintenance with Request No. - " + (CurrentMaintenanceRequest.RequestNo).ToUpper() + "'");
     }
     else
     {
         EmailSender.Send(GetSuperviser(_controller.GetAssignedJobbycurrentuser(VRS.Approver).AssignedTo).Email, " Car Maintenance Request", (CurrentMaintenanceRequest.AppUser.FullName).ToUpper() + " Requests for Car Maintenance with Request No. - " + (CurrentMaintenanceRequest.RequestNo).ToUpper() + "'");
     }
 }
예제 #4
0
 private void SendEmail(MaintenanceRequestStatus PRS)
 {
     if (_presenter.GetSuperviser(PRS.Approver).IsAssignedJob != true)
     {
         EmailSender.Send(_presenter.GetSuperviser(PRS.Approver).Email, "Maintenance Request", _presenter.GetUser(_presenter.CurrentMaintenanceRequest.Requester).FullName + "' Request for Car Maintenance Request No. '" + _presenter.CurrentMaintenanceRequest.RequestNo + "'");
     }
     else
     {
         EmailSender.Send(_presenter.GetSuperviser(_presenter.GetAssignedJobbycurrentuser(PRS.Approver).AssignedTo).Email, "Maintenance Request", _presenter.GetUser(_presenter.CurrentMaintenanceRequest.Requester).FullName + "' Request for Car Maintenance Request No. '" + _presenter.CurrentMaintenanceRequest.RequestNo + "'");
     }
 }
        private void SendEmailRejected(MaintenanceRequestStatus MRS)
        {
            EmailSender.Send(_presenter.GetUser(_presenter.CurrentMaintenanceRequest.AppUser.Id).Email, "Maintenance Request Rejection", "Your Maintenance Request with Sole Vendor Request No. " + (_presenter.CurrentMaintenanceRequest.RequestNo).ToUpper() + " was Rejected by " + _presenter.CurrentUser().FullName + " for this reason - '" + (MRS.RejectedReason).ToUpper() + "'");


            if (MRS.WorkflowLevel > 1)
            {
                for (int i = 0; i + 1 < MRS.WorkflowLevel; i++)
                {
                    EmailSender.Send(_presenter.GetUser(_presenter.CurrentMaintenanceRequest.MaintenanceRequestStatuses[i].Approver).Email, "Maintenance Request Rejection", "Maintenance  Request with Maintenance Request No. - " + (_presenter.CurrentMaintenanceRequest.RequestNo).ToUpper() + " made by " + (_presenter.GetUser(_presenter.CurrentMaintenanceRequest.AppUser.Id).FullName).ToUpper() + " was Rejected by " + _presenter.CurrentUser().FullName + " for this reason - '" + (MRS.RejectedReason).ToUpper() + "'");
                }
            }
        }
예제 #6
0
        private void SaveMaintenanceRequestStatus()
        {
            if (GetApprovalSetting(RequestType.Maintenance_Request.ToString().Replace('_', ' '), 0) != null)
            {
                int i = 1;
                foreach (ApprovalLevel AL in GetApprovalSetting(RequestType.Maintenance_Request.ToString().Replace('_', ' '), 0).ApprovalLevels)
                {
                    MaintenanceRequestStatus MRS = new MaintenanceRequestStatus();
                    MRS.MaintenanceRequest = CurrentMaintenanceRequest;
                    if (AL.EmployeePosition.PositionName == "Superviser/Line Manager")
                    {
                        if (CurrentUser().Superviser != 0)
                        {
                            MRS.Approver = CurrentUser().Superviser.Value;
                        }
                        else
                        {
                            MRS.ApprovalStatus = ApprovalStatus.Approved.ToString();
                            MRS.Date           = Convert.ToDateTime(DateTime.Today.Date.ToShortDateString());
                        }
                    }
                    else if (AL.EmployeePosition.PositionName == "Program Manager")
                    {
                        if (CurrentMaintenanceRequest.Project.Id != 0)
                        {
                            MRS.Approver = GetProject(CurrentMaintenanceRequest.Project.Id).AppUser.Id;
                        }
                    }
                    else
                    {
                        if (Approver(AL.EmployeePosition.Id).Id != 0)
                        {
                            MRS.Approver = Approver(AL.EmployeePosition.Id).Id;
                        }
                        else
                        {
                            MRS.Approver = 0;
                        }
                    }

                    //else
                    //{
                    //    PRS.Approver = _presenter.Approver(AL.EmployeePosition.Id).Id;
                    //}
                    MRS.WorkflowLevel = i;
                    i++;
                    CurrentMaintenanceRequest.MaintenanceRequestStatuses.Add(MRS);
                }
            }
        }