private string GetWillStatus()
        {
            ApprovalSetting AS = null;

            if (_presenter.CurrentCashPaymentRequest.RequestType == "Medical Expense (In-Patient)" || _presenter.CurrentCashPaymentRequest.RequestType == "Medical Expense (Out-Patient)")
            {
                AS = _presenter.GetApprovalSettingMedical();
            }
            else
            {
                AS = _presenter.GetApprovalSettingforProcess(RequestType.CashPayment_Request.ToString().Replace('_', ' ').ToString(), _presenter.CurrentCashPaymentRequest.TotalAmount);
            }

            string will = "";

            foreach (ApprovalLevel AL in AS.ApprovalLevels)
            {
                if ((AL.EmployeePosition.PositionName == "Superviser/Line Manager" || AL.EmployeePosition.PositionName == "Program Manager") && AL.WorkflowLevel == _presenter.CurrentCashPaymentRequest.CurrentLevel)
                {
                    will = "Approve";
                    break;
                }
                else if (_presenter.CurrentCashPaymentRequest.AppUser.Superviser == _presenter.CurrentCashPaymentRequest.CurrentApprover && AL.WorkflowLevel == _presenter.CurrentCashPaymentRequest.CurrentLevel)
                {
                    //If the current approver is the supervisor of the requester
                    //Eg. Dr. Rahel is supervisor of Seble and she must approve Medical requested by Seble rather than Seble approving her requests
                    will = "Approve";
                    break;
                }
                else
                {
                    try
                    {
                        if (_presenter.GetUser(_presenter.CurrentCashPaymentRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName && AL.WorkflowLevel == _presenter.CurrentCashPaymentRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                    catch
                    {
                        if (_presenter.CurrentCashPaymentRequest.CurrentApproverPosition == AL.EmployeePosition.Id && AL.WorkflowLevel == _presenter.CurrentCashPaymentRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                }
            }
            return(will);
        }
Beispiel #2
0
        private string GetWillStatus()
        {
            ApprovalSetting AS = null;

            if (_presenter.CurrentCashPaymentRequest.RequestType == "Medical")
            {
                AS = _presenter.GetApprovalSettingMedical();
            }
            else
            {
                AS = _presenter.GetApprovalSettingforProcess(RequestType.CashPayment_Request.ToString().Replace('_', ' ').ToString(), _presenter.CurrentCashPaymentRequest.TotalAmount);
            }

            string will = "";

            foreach (ApprovalLevel AL in AS.ApprovalLevels)
            {
                if ((AL.EmployeePosition.PositionName == "Superviser/Line Manager" || AL.EmployeePosition.PositionName == "Program Manager"))
                {
                    will = "Approve";
                    break;
                }

                /*else if (_presenter.GetUser(_presenter.CurrentCashPaymentRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName)
                 * {
                 *  will = AL.Will;
                 * }*/
                else
                {
                    try
                    {
                        if (_presenter.GetUser(_presenter.CurrentCashPaymentRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName && AL.WorkflowLevel == _presenter.CurrentCashPaymentRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                    catch
                    {
                        if (_presenter.CurrentCashPaymentRequest.CurrentApproverPosition == AL.EmployeePosition.Id && AL.WorkflowLevel == _presenter.CurrentCashPaymentRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                }
            }
            return(will);
        }
Beispiel #3
0
        private string GetWillStatus()
        {
            ApprovalSetting AS   = _presenter.GetApprovalSettingforProcess(RequestType.BankPayment_Request.ToString().Replace('_', ' ').ToString(), 0);
            string          will = "";

            foreach (ApprovalLevel AL in AS.ApprovalLevels)
            {
                if (AL.EmployeePosition.PositionName == "Superviser/Line Manager" || AL.EmployeePosition.PositionName == "Program Manager" && _presenter.CurrentBankPaymentRequest.CurrentLevel == 1)
                {
                    will = "Approve";
                }
                else if (_presenter.GetUser(_presenter.CurrentBankPaymentRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName)
                {
                    will = AL.Will;
                }
            }
            return(will);
        }
        private string GetWillStatus()
        {
            ApprovalSetting AS   = _presenter.GetApprovalSettingforProcess(RequestType.Maintenance_Request.ToString().Replace('_', ' ').ToString(), 0);
            string          will = "";

            foreach (ApprovalLevel AL in AS.ApprovalLevels)
            {
                if ((AL.EmployeePosition.PositionName == "Superviser/Line Manager" || AL.EmployeePosition.PositionName == "Program Manager") && _presenter.CurrentMaintenanceRequest.CurrentLevel == 1)
                {
                    will = "Approve";
                    break;
                }



                //else if (_presenter.GetUser(_presenter.CurrentMaintenanceRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName)
                //{
                //    will = AL.Will;
                //}


                else
                {
                    try
                    {
                        if (_presenter.GetUser(_presenter.CurrentMaintenanceRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName && AL.WorkflowLevel == _presenter.CurrentMaintenanceRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                    catch
                    {
                        if (_presenter.GetUser(_presenter.CurrentMaintenanceRequest.CurrentApprover).EmployeePosition.Id == AL.EmployeePosition.Id && AL.WorkflowLevel == _presenter.CurrentMaintenanceRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                }
            }
            return(will);
        }
Beispiel #5
0
        private string GetWillStatus()
        {
            ApprovalSetting AS   = _presenter.GetApprovalSettingforProcess(RequestType.ExpenseLiquidation_Request.ToString().Replace('_', ' ').ToString(), 0);
            string          will = "";

            foreach (ApprovalLevel AL in AS.ApprovalLevels)
            {
                if (AL.EmployeePosition.PositionName == "Superviser/Line Manager" || AL.EmployeePosition.PositionName == "Program Manager" && AL.WorkflowLevel == _presenter.CurrentExpenseLiquidationRequest.CurrentLevel)
                {
                    will = "Approve";
                    break;
                }

                /*else if (_presenter.GetUser(_presenter.CurrentExpenseLiquidationRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName)
                 * {
                 *  will = AL.Will;
                 * }*/
                else
                {
                    try
                    {
                        if (_presenter.GetUser(_presenter.CurrentExpenseLiquidationRequest.CurrentApprover).EmployeePosition.PositionName == AL.EmployeePosition.PositionName && AL.WorkflowLevel == _presenter.CurrentExpenseLiquidationRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                    catch
                    {
                        if (_presenter.CurrentExpenseLiquidationRequest.CurrentApproverPosition == AL.EmployeePosition.Id && AL.WorkflowLevel == _presenter.CurrentExpenseLiquidationRequest.CurrentLevel)
                        {
                            will = AL.Will;
                            break;
                        }
                    }
                }
            }
            return(will);
        }
Beispiel #6
0
 public void DeleteApprovalSetting(ApprovalSetting approvalsetting)
 {
     _controller.DeleteEntity(approvalsetting);
 }
Beispiel #7
0
 public void SaveOrUpdateApprovalSetting(ApprovalSetting ApprovalSetting)
 {
     _controller.SaveOrUpdateEntity(ApprovalSetting);
 }