Ejemplo n.º 1
0
    public void UpdateApplicationStatus(string Status, int currentAppStatus)
    {
        InsertAppTrail();
        if (Status == "Forward Application")
        {
            mainDSTableAdapters .opt_application_statusTableAdapter AppStatus = new mainDSTableAdapters.opt_application_statusTableAdapter ();
            int nextID =Convert.ToInt32(AppStatus.getNextStageID(currentAppStatus));
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(nextID,MySessionManager.AppID);
            loanApps.UpdateReviewStatus(null, MySessionManager.AppID);
            setAppMoveDetails(nextID, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);

        }
        if (Status == "Forward Application To Approval")
        {
            //mainDSTableAdapters.opt_application_statusTableAdapter AppStatus = new mainDSTableAdapters.opt_application_statusTableAdapter();
            //int nextID = Convert.ToInt32(AppStatus.getNextStageID(currentAppStatus));
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(7, MySessionManager.AppID);
            loanApps.UpdateReviewStatus(null, MySessionManager.AppID);
            setAppMoveDetails(7, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }
        else if (Status == "Decline Application")
        {
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateApplicationRejection(17, currentAppStatus, MySessionManager.AppID);
            setAppMoveDetails(17, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }
        else if (Status == "Forward To Risk")
        {
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(5, MySessionManager.AppID);
            setAppMoveDetails(5, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }
        else if (Status == "Forward To Legal")
        {
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(6, MySessionManager.AppID);
            setAppMoveDetails(6, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }
        else if (Status == "Forward To Credit Team")
        {
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(4, MySessionManager.AppID);
            loanApps.UpdateReviewStatus(null, MySessionManager.AppID);
            setAppMoveDetails(4, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }
        else if (Status == "Send Back For Review")
        {
            int appstatus = currentAppStatus - 1;
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(appstatus, MySessionManager.AppID);
            loanApps.UpdateReviewStatus(true, MySessionManager.AppID);
            setAppMoveDetails(appstatus, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);

        }
        else if (Status == "Send Back For Review To Appraisal")
        {
            int appstatus =4;
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(appstatus, MySessionManager.AppID);
            loanApps.UpdateReviewStatus(true, MySessionManager.AppID);
            setAppMoveDetails(appstatus, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }
        else if (Status == "Forward to Approved Loans")
        {
            int appstatus = 12;
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApps = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            loanApps.UpdateAppStatus(appstatus, MySessionManager.AppID);
            loanApps.UpdateReviewStatus(null, MySessionManager.AppID);
            setAppMoveDetails(appstatus, DateTime.Now, MySessionManager.CurrentUser.UserID, MySessionManager.AppID);
        }

        else if (Status == "Forward to COO")
        { 
        
        
        
        
        }

    }