Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     #region BasTemplate
     if (!IsPostBack)
     {
         Template.BasTemplate objBasTemplate = new Template.BasTemplate();
         try
         {
             if (Request.Cookies["Session_ID"] == null)
             {
                 Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", false);
             }
             string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, true);
             if (strResult != "")
             {
                 Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                 return;
             }
             objBasTemplate.SetSeatchField(0);
             objBasTemplate.ShowNotes                  = false;
             LblTemplateHeader2.Text                   = objBasTemplate.Header2();
             ViewState["AccessType"]                   = objBasTemplate.strAccessType;
             ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
             ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
             ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
             ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
             ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
             ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
             ViewState["User_ID"]           = objBasTemplate.strUser_ID;
             ViewState["User_Name"]         = objBasTemplate.strUser_Name;
             ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
             // Wizard
             string strpnlXML = objBasTemplate.PanelXML();
             if (strpnlXML != "")
             {
                 if (strpnlXML.IndexOf("Error:") != -1)
                 {
                     Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                     return;
                 }
                 ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                 ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                 ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                 ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                 ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                 ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                 ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                 ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                 ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                 ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                 ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                 ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                 ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                 ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                 ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                 ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                 ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                 ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                 ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                 ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                 ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
             }
         }
         catch (Exception ex)
         {
             string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
             Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
         }
         finally
         {
             objBasTemplate.CleanUp();
             objBasTemplate.Dispose();
         }
     }
     #endregion
     ProcessCommad();
     if (!string.IsNullOrEmpty(hidCommand.Value))
     {
         if (hidCommand.Value.Equals("DoLoad"))
         {
             hidCommand.Value = string.Empty;
             LoadImage();
             return;
         }
         if (hidCommand.Value.Equals("DoSave"))
         {
             hidCommand.Value = string.Empty;
             //btnSave_Click(null, null);
             DoSave();
             return;
         }
     }
     btnLoad.Attributes.Add("onclick", "Do_Load()");
     btnSave.Attributes.Add("onclick", "Do_Save()");
     if (!IsPostBack)
     {
         ViewState["Employee_Number"] = Data.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
         Bas_Utility.Utilities.SetValidators(this.Page);
         Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
         try
         {
             ViewState["Book"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "BookRequest", conn);
             ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", conn);
             ViewState["AppStatus"]         = Data.ApplicationStatus(ViewState["Request_Record_ID"].ToString());
             ViewState["Product_Code"]      = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Product_Code", conn);
             lblBalance.Text     = Data.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString(), conn);
             lblCourseTitle.Text = Data.CourseName(ViewState["Request_Record_ID"].ToString(), conn);
         }
         finally
         {
             conn.Close();
             conn.Dispose();
         }
         RadTabStrip1.Tabs[0].Selected = true;
         RadTabStrip1_TabClick(null, null);
         SetHeaderInformation();
         Data.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
         ProcessesStarFunctionality();
         SetupWizardMenu();
     }
 }
Пример #2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Training_Source.TrainingClass.SessionHasTimeOut(Request.Cookies["Session_ID"].Value.ToString()))
            {
                Response.Redirect("/Web_Projects/trn/PLA/out.aspx?message=Your Session has timed out" + "&backurl=0", true);
            }
            lblScript.Text            = "";
            lblOtherTextError.Visible = false;
            #region BasTemplate
            if (!IsPostBack)
            {
                Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                try
                {
                    if (Request.Cookies["Session_ID"] == null)
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                    }
                    string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, false);
                    if (strResult != "")
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                        return;
                    }
                    objBasTemplate.SetSeatchField(0);
                    objBasTemplate.ShowNotes                  = false;
                    LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                    ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                    ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                    ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                    ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                    ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                    ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                    ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                    ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                    ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                    ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                    // Wizard
                    string strpnlXML = objBasTemplate.PanelXML();
                    if (strpnlXML != "")
                    {
                        if (strpnlXML.IndexOf("Error:") != -1)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                            return;
                        }
                        ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                        ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                        ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                        ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                        ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                        ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                        ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                        ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                        ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                        ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                        ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                        ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                        ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                        ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                        ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                        ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                        ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                        ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                        ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                        ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                        ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                    }
                }
                catch (Exception ex)
                {
                    string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                    Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                }
                finally
                {
                    objBasTemplate.CleanUp();
                    objBasTemplate.Dispose();
                }
            }
            #endregion

            if (!IsPostBack)
            {
                ViewState["NextStpUrl"] = "TrainingExpenses.aspx";
                ViewState["PrvStpUrl"]  = "CourseDateAndTime.aspx";
                Training_Source.TrainingClass.SetValidators(Page);
                lbTypeofDev.Width            = System.Web.UI.WebControls.Unit.Pixel(1);
                lbTypeofDev.Height           = System.Web.UI.WebControls.Unit.Pixel(1);
                lbTypeofDev.ForeColor        = System.Drawing.Color.White;
                lbTypeofDev.BorderStyle      = System.Web.UI.WebControls.BorderStyle.None;
                ViewState["Employee_Number"] = Training_Source.TrainingClass.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
                //if (ViewState["User_Group_ID"].ToString()!="1")
                //{
                //    string strMesg = Training_Source.TrainingClass.IsEeDataOk(ViewState["Employee_Number"].ToString());
                //    if (strMesg!="")
                //        Response.Redirect("out.aspx?message="+strMesg,true);
                //}

                this.LblTemplateHeader2.Text = Template.BasTemplate.Update_Header(this.LblTemplateHeader2.Text, "Edit Mode");
                btnSaveBack.Text             = "";
                btnSaveBack.BorderStyle      = System.Web.UI.WebControls.BorderStyle.None;
                btnSaveBack.ForeColor        = System.Drawing.Color.White;
                btnSaveBack.Width            = System.Web.UI.WebControls.Unit.Pixel(1);
                btnSaveBack.Height           = System.Web.UI.WebControls.Unit.Pixel(1);

                btnSaveNext.Text        = "";
                btnSaveNext.BorderStyle = System.Web.UI.WebControls.BorderStyle.None;
                btnSaveNext.ForeColor   = System.Drawing.Color.White;
                btnSaveNext.Width       = System.Web.UI.WebControls.Unit.Pixel(1);
                btnSaveNext.Height      = System.Web.UI.WebControls.Unit.Pixel(1);

                txtSelectedDevelopments.Text        = "";
                txtSelectedDevelopments.BorderStyle = System.Web.UI.WebControls.BorderStyle.None;
                txtSelectedDevelopments.ForeColor   = System.Drawing.Color.White;
                txtSelectedDevelopments.Width       = System.Web.UI.WebControls.Unit.Pixel(1);
                txtSelectedDevelopments.Height      = System.Web.UI.WebControls.Unit.Pixel(1);

                lblBalance.Text = Training_Source.TrainingClass.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", Training_Source.TrainingClass.ConnectioString);
                ViewState["Mandatory_Only"]    = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Mandatory_Only", Training_Source.TrainingClass.ConnectioString);
                SetHeaderInformation();
                FillDropDowns();
                FillData();
                if (txtDepartmentID.Text == "")
                {
                    GetDeptId();
                }
                FillSelectedTypeofDevelopment();
                FillTypeofDevelopment();
                SetInView();
                lblScript.Text = "<script>EnableNavigation()</script>";
                ProcessesStarFunctionality();
                SetInintialCheckBoxTestField();
                string strProcessingYear = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "CoursePY", Training_Source.TrainingClass.ConnectioString);
                string strWarning        = "The training request you are appling for is in development year \"" + strProcessingYear + "\". You do not have an approved CDP for this year. You may not change the selected Account#";
                if (!Training_Source.TrainingClass.aquiredpreaproval(ViewState["Employee_Number"].ToString(), strProcessingYear))
                {
                    if (TrainingTypeAndNeedsRecord_Id() == "-1")
                    {
                        lblMandatoryOnly.Text             = strWarning;
                        opnlstAccountNumber.SelectedIndex = 1;
                    }
                    else
                    {
                        lblMandatoryOnly.Text = "The training request you are appling for is in development year \"" + strProcessingYear + "\". You do not have an approved CDP for this year. Your request must be for a \"Other Training (Mandatory) (5633)\" to be able to submit this training request later.";
                    }
                    opnlstAccountNumber.Enabled = false;
                    SetupWizardMenu();
                }
                Training_Source.TrainingClass.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), strProcessingYear);
            }
            CheckHeaderIDSet();
            HandleContractors();
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Training_Source.TrainingClass.SessionHasTimeOut(Request.Cookies["Session_ID"].Value.ToString()))
            {
                Response.Redirect("/Web_Projects/trn/PLA/out.aspx?message=Your Session has timed out" + "&backurl=0", true);
            }

            #region BasTemplate
            if (!IsPostBack)
            {
                Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                try
                {
                    if (Request.Cookies["Session_ID"] == null)
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                    }
                    string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, true);
                    if (strResult != "")
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                        return;
                    }
                    objBasTemplate.SetSeatchField(0);
                    objBasTemplate.ShowNotes                  = false;
                    LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                    ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                    ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                    ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                    ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                    ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                    ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                    ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                    ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                    ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                    ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                    // Wizard
                    string strpnlXML = objBasTemplate.PanelXML();
                    if (strpnlXML != "")
                    {
                        if (strpnlXML.IndexOf("Error:") != -1)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                            return;
                        }
                        ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                        ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                        ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                        ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                        ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                        ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                        ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                        ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                        ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                        ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                        ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                        ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                        ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                        ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                        ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                        ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                        ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                        ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                        ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                        ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                        ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                    }
                }
                catch (Exception ex)
                {
                    string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                    Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                }
                finally
                {
                    objBasTemplate.CleanUp();
                    objBasTemplate.Dispose();
                }
            }
            #endregion

            lblErrorPassword.Visible = false;
            lblScript.Text           = "";
            if (!IsPostBack)
            {
                Training_Source.TrainingClass.SetValidators(Page);
                ViewState["Employee_Number"] = Training_Source.TrainingClass.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
                ViewState["Book"]            = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "BookRequest");
                if (ViewState["User_Group_ID"].ToString() == "2")
                {
                    Response.Redirect("out.aspx?message=" + "You are currently logged in as Benefit Administrator. You must logon as an Employee to access this program.", true);
                    return;
                }
                //if (ViewState["User_Group_ID"].ToString()!="1")
                //{
                //    string strMesg = Training_Source.TrainingClass.IsEeDataOk(ViewState["Employee_Number"].ToString());
                //    if (strMesg!="")
                //        Response.Redirect("out.aspx?message="+strMesg,true);
                //}



                lblBalance.Text = Training_Source.TrainingClass.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                SQLStatic.Sessions.SetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Applicant_Employee_Number", ViewState["Employee_Number"].ToString(), Training_Source.TrainingClass.ConnectioString);

                ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", Training_Source.TrainingClass.ConnectioString);
                if ((Request.Params["action"] != null) && (Request.Params["action"] == "PLA"))
                {
                    ProcessChangeAccountNumber();
                }
                if (ViewState["Request_Record_ID"].ToString() == "-1")
                {
                    lblScript.Text = "<script>alert('Vendor Information page must be completed first');window.location.href='TrainingVendorInfo.aspx';</script>";
                    return;
                }
                if ((Request.Params["c"] != "y") && (Training_Source.TrainingClass.HasPendingEvaluation(ViewState["Employee_Number"].ToString())))
                {
                    lblScript.Text = "<script>alert('You cannot submit a new training request until you have completed the pending post-training evaluation form associated with another training request.  Please find the training request with the status “Pending Evaluation”, and use the Action Drop Down Item – Review Eval. – to complete your evaluation.  Afterwards, you may choose “Edit Request” from the Action Drop Down Box for this new training request and process your submission.');window.location.href='SelectApp.aspx';</script>";
                    return;
                }
                if ((Request.Params["c"] != "y") && (Request.Params["c"] != "r"))
                {
                    PLA_AccountNo();
                    if (ViewState["AccountNo"].ToString() == "5633")
                    {
                        string strResetAccountNo = "<script>CheckResetAccountNumber();</script>";
                        Page.ClientScript.RegisterStartupScript(Page.GetType(), "strResetAccountNo", strResetAccountNo);
                        return;
                    }
                }
                ViewState["Product_Code"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Product_Code", Training_Source.TrainingClass.ConnectioString);
                SetHeaderInformation();
                ViewState["AppStatus"] = Training_Source.TrainingClass.ApplicationStatus(ViewState["Request_Record_ID"].ToString());
                ShowCurrentSupervisor();
                string strProcessingYear = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "CoursePY", Training_Source.TrainingClass.ConnectioString);
                Training_Source.TrainingClass.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), strProcessingYear);
//				check if there is enough budget to submit the application in the budget year of the tapplication
                Check_budget(ViewState["Employee_Number"].ToString(), strProcessingYear);

                if (txtSupervisorName.Text.Trim() == "")
                {
                    lblScript.Text = "<script>alert('You must select your supervisor first');window.location.href='ManageSupervisor.aspx';</script>";
                    return;
                }
                if (!CDPAquired())
                {
                    lblScript.Text = "<script>alert('You cannot submit this training request. You must have an approved CDP application first.');window.location.href='SelectApp.aspx';</script>";
                    return;
                }
                if (SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Reroute_Found_Employee_Number", Training_Source.TrainingClass.ConnectioString) != "")
                {
                    ReadNameAndNumber();
                }
                if ((Request.Params["c"] != "y") && (Request.Params["c"] != "r"))
                {
                    SetupWizardMenu();
                }
            }
            strConfirmationNotice = "Immediately upon your Supervisor’s decision to approve or decline your training request, MyEnroll.com will send you an email confirmation notice.";

            if (Request.Params["c"] == "y")
            {
                lblLine1.Text         = "Confirm Cancellation";
                strConfirmationNotice = "Training request has been canceled";
                btnSave.Text          = "Save & Cancel Request";
            }
            if (Request.Params["c"] == "r")
            {
                lblLine1.Text         = "Reactivate Request";
                strConfirmationNotice = "Training request has been reactivated";
                btnSave.Text          = "Save & Activate Request";
            }
            if ((Request.Params["c"] == "y") || (Request.Params["c"] == "r"))
            {
                btnSave.Text = "Save & Apply Request";
            }
            else
            {
                if (ViewState["Supervisor_Employee_Number"].ToString() == "")
                {
                    lblLine1.Text   = "Your Supervisor is unkown, you cannot submit your application";
                    btnSave.Enabled = false;
                }
                string strCanAccess = CanAccess();
                if (strCanAccess != "T")
                {
                    if (strCanAccess == "SCH")
                    {
                        lblScript.Text = "<script>alert('You must Fill The Course Dates & Times Page First');window.location.href='CourseDateAndTime.aspx';</script>";
                    }
                    else if (strCanAccess == "TYP")
                    {
                        lblScript.Text = "<script>alert('You must Fill The Training Types & Needs Page First');window.location.href='TrainingTypesAndNeeds.aspx';</script>";
                    }
                    else if (strCanAccess == "EXP")
                    {
                        lblScript.Text = "<script>alert('You must Fill The Training Expenses Page First');window.location.href='TrainingExpenses.aspx';</script>";
                    }
                    else
                    {
                        lblLine1.Text = "Error:";
                        lblLine2.Text = "You must complete all the application pages before you can submit it for approval";
                    }
                }
                else
                {
                    if (Convert.ToInt32(ViewState["AppStatus"].ToString()) == 0)
                    {
                        if (ViewState["Book"].ToString() == "1")
                        {
                            lblLine1.Text = "Your training book request is ready to be sent to your supervisor for review.";
                            lblLine2.Text = "Complete the \"Signature Block\" below and click the ‘Save’ button to submit your book request.";
                        }
                        else
                        {
                            lblLine1.Text = "Your training request is ready to be sent to your supervisor for review.";
                            lblLine2.Text = "Complete the \"Signature Block\" below and click the ‘Save’ button to submit your request.";
                        }
                    }
                    if (Convert.ToInt32(ViewState["AppStatus"].ToString()) == 1)
                    {
                        string strInitialStatus = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Initial_Status", Training_Source.TrainingClass.ConnectioString);
                        if (strInitialStatus == "2")
                        {
                            lblLine1.Text   = "Your edits have been saved.";
                            btnSave.Enabled = false;
                            lblLine2.Text   = "Your changes are material; therefore, the system has automatically removed your request from “Pending Payment” status and resubmitted it to your supervisor for review.";
                        }
                        else
                        {
                            lblLine1.Text   = "Your edits have been saved and are pending your supervisor’s review.";
                            btnSave.Enabled = false;
                            lblLine2.Text   = "";
                        }
                    }
                    if (Convert.ToInt32(ViewState["AppStatus"].ToString()) == 2)
                    {
                        lblLine1.Text   = "Your edits have been saved.";
                        lblLine2.Text   = "Your changes were not material; therefore, your training request will remain in \"Pending Payment\" status.";
                        btnSave.Enabled = false;
                    }
                }
            }
            HandleContractors();
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Training_Source.TrainingClass.SessionHasTimeOut(Request.Cookies["Session_ID"].Value.ToString()))
            {
                Response.Redirect("/Web_Projects/trn/PLA/out.aspx?message=Your Session has timed out" + "&backurl=0", true);
            }
            lblScript.Text = "";
            if (Request.Params["Admin"] != "YES")
            {
                #region BasTemplate
                if (!IsPostBack)
                {
                    Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                    try
                    {
                        if (Request.Cookies["Session_ID"] == null)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                        }
                        string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, true);
                        if (strResult != "")
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                            return;
                        }
                        objBasTemplate.SetSeatchField(0);
                        objBasTemplate.ShowNotes                  = false;
                        LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                        ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                        ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                        ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                        ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                        ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                        ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                        ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                        ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                        ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                        ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                        // Wizard
                        string strpnlXML = objBasTemplate.PanelXML();
                        if (strpnlXML != "")
                        {
                            if (strpnlXML.IndexOf("Error:") != -1)
                            {
                                Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                                return;
                            }
                            ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                            ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                            ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                            ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                            ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                            ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                            ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                            ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                            ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                            ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                            ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                            ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                            ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                            ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                            ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                            ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                            ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                            ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                            ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                            ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                            ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                        }
                    }
                    catch (Exception ex)
                    {
                        string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                    }
                    finally
                    {
                        objBasTemplate.CleanUp();
                        objBasTemplate.Dispose();
                    }
                }
                #endregion
            }
            else
            {
                #region BasTemplate
                if (!IsPostBack)
                {
                    Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                    try
                    {
                        if (Request.Cookies["Session_ID"] == null)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                        }
                        string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, false);
                        if (strResult != "")
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                            return;
                        }
                        objBasTemplate.SetSeatchField(0);
                        objBasTemplate.ShowNotes                  = false;
                        LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                        ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                        ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                        ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                        ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                        ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                        ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                        ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                        ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                        ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                        ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;

                        // setup header information. You need to add the "2nd" and "3rd" parmeter.
                    }
                    catch (Exception ex)
                    {
                        string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                    }
                    finally
                    {
                        objBasTemplate.CleanUp();
                        objBasTemplate.Dispose();
                    }
                }
                #endregion
                btnHome.Visible = false;
                btnNext.Visible = false;
            }
            if (!IsPostBack)
            {
                ViewState["Employee_Number"] = Training_Source.TrainingClass.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
                //if (ViewState["User_Group_ID"].ToString()!="1")
                //{
                //    string strMesg = Training_Source.TrainingClass.IsEeDataOk(ViewState["Employee_Number"].ToString());
                //    if (strMesg!="")
                //        Response.Redirect("out.aspx?message="+strMesg,true);
                //}

                lblBalance.Text = Training_Source.TrainingClass.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", Training_Source.TrainingClass.ConnectioString);
                SetHeaderInformation();
                SetInView();
                ProcessesStarFunctionality();
                string strProcessingYear = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "CoursePY", Training_Source.TrainingClass.ConnectioString);
                if (strProcessingYear == "")
                {
                    strProcessingYear = ViewState["Processing_Year"].ToString();
                }
                Training_Source.TrainingClass.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), strProcessingYear);
                if (!Training_Source.TrainingClass.Use2008Types_Needs(ViewState["Request_Record_ID"].ToString()))
                {
                    ViewState["PrvStpUrl"] = "TrainingTypesAndNeeds.aspx";
                }
                if (Request.Params["Admin"] != "YES")
                {
                    SetupWizardMenu();
                }
            }
            DrawGrid();
            CheckHeaderIDSet();
            HandleContractors();
            if (!(Request.Form["doSave"] == null || Request.Form["doSave"] == ""))
            {
                DoDelete();
                doSave.Value = "";
                DrawGrid();
            }
        }
Пример #5
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Data.SessionHasTimeOut(Request.Cookies["Session_ID"].Value.ToString()))
            {
                Response.Redirect("/Web_Projects/trn/PLA/out.aspx?message=Your Session has timed out" + "&backurl=0", true);
            }
            #region BasTemplate
            if (!IsPostBack)
            {
                Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                try
                {
                    if (Request.Cookies["Session_ID"] == null)
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", false);
                    }
                    string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, true);
                    if (strResult != "")
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                        return;
                    }
                    objBasTemplate.SetSeatchField(0);
                    objBasTemplate.ShowNotes                  = false;
                    LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                    ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                    ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                    ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                    ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                    ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                    ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                    ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                    ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                    ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                    ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                    // Wizard
                    string strpnlXML = objBasTemplate.PanelXML();
                    if (strpnlXML != "")
                    {
                        if (strpnlXML.IndexOf("Error:") != -1)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                            return;
                        }
                        ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                        ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                        ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                        ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                        ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                        ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                        ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                        ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                        ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                        ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                        ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                        ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                        ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                        ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                        ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                        ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                        ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                        ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                        ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                        ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                        ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                    }
                }
                catch (Exception ex)
                {
                    string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                    Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                }
                finally
                {
                    objBasTemplate.CleanUp();
                    objBasTemplate.Dispose();
                }
            }
            #endregion


            if ((hidCommand.Value != null) && (hidCommand.Value == "DoSave"))
            {
                hidCommand.Value = "";

                CheckSave();
                return;
            }
            lblScript.Text = "";
            if (!IsPostBack)
            {
                btnSave.Attributes.Add("onclick", "Do_Save()");
                //Data.SetValidators(Page);
                ViewState["Employee_Number"] = Data.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
                //if (ViewState["User_Group_ID"].ToString()!="1")
                //{
                //    string strMesg = Data.IsEeDataOk(ViewState["Employee_Number"].ToString());
                //    if (strMesg!="")
                //        Response.Redirect("out.aspx?message="+strMesg,true);
                //}
                lblBalance.Text = Data.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                SetHeaderInformation();
                FillSatesDropDown();
                FillContries();
                Oracle.DataAccess.Client.OracleConnection conn = SQLStatic.SQL.OracleConnection();
                try
                {
                    ViewState["Book"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "BookRequest", conn);
                    ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", conn);
                    ViewState["AppStatus"]         = Data.ApplicationStatus(ViewState["Request_Record_ID"].ToString());
                    ViewState["Product_Code"]      = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Product_Code", conn);
                }
                finally
                {
                    conn.Close();
                    conn.Dispose();
                }
                lbl_fldTrainingVendor.Visible     = true;
                lbl_fldTrainingVendorBook.Visible = false;
                if (ViewState["Book"].ToString() == "1")
                {
                    SetupForBook();
                }
                FillData();
                SetInView();
                HighLightKeyFields();
                //lblScript.Text="<script>EnableNavigation()</script>";
                ProcessesStarFunctionality();
                SetupWizardMenu();
                if (ViewState["Request_Record_ID"].ToString() == "-1")
                {
                    if (ViewState["Book"].ToString() != "1")
                    {
                        string strAlert = "<script>alert('REMINDER: This is a reminder to employees whose training request might involve travel – you must include your estimated travel expenses in the expense page of the training request – although it will NOT deduct from your PLA funds.')</script>";
                        Page.ClientScript.RegisterStartupScript(Page.GetType(), "strAlert", strAlert);
                    }
                }
            }
            if (!(Request.Form["doSave"] == null || Request.Form["doSave"] == ""))
            {
                string strGoTo = Request.Form["doSave"].Replace("'", "");
                doSave.Value = "";
                this.Validate();
                if (this.IsValid)
                {
                    DoSave();
                    Response.Redirect(strGoTo);
                }
            }
            HandleContractors();
        }
Пример #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (PLA_Approval.TrainingClass.SessionHasTimeOut(Request.Cookies["Session_ID"].Value.ToString()))
            {
                Response.Redirect("/Web_Projects/trn/PLA/out.aspx?message=Your Session has timed out" + "&backurl=0", true);
            }
            lblScript.Text = "";
            #region BasTemplate
            if (!IsPostBack)
            {
                Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                try
                {
                    if (Request.Cookies["Session_ID"] == null)
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                    }
                    string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, false);
                    if (strResult != "")
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult.Replace("\n", "~"), false);
                        return;
                    }
                    LblTemplateHeader1.Text = objBasTemplate.Header1();
                    LblTemplateHeader2.Text = objBasTemplate.Header2();
                    LblTemplateFooter.Text  = objBasTemplate.Footer();
                    um.MenuSourceXml        = objBasTemplate.MenuXML();
                    um.DataBind();
                    ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                    ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                    ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                    ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                    ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                    ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                    ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                    ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                    ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                    ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                    // Wizard
                    string strpnlXML = objBasTemplate.PanelXML();
                    if (strpnlXML != "")
                    {
                        if (strpnlXML.IndexOf("Error:") != -1)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML.Replace("\n", "~"), false);
                            return;
                        }
                        upPO.PanelSourceXml = strpnlXML;
                        upPO.DataBind();
                        ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                        ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                        ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                        ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                        ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                        ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                        ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                        ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                        ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                        ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                        ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                        ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                        ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                        ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                        ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                        ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                        ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                        ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                        ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                        ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                        ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                    }
                }
                catch (Exception ex)
                {
                    string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                    Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                }
                finally
                {
                    objBasTemplate.CleanUp();
                    objBasTemplate.Dispose();
                }
            }
            #endregion
            LblTemplateHeader1.Text = Template.BasTemplate.ChangeLogo(LblTemplateHeader1.Text, 1);
            if (!IsPostBack)
            {
                SetCurrentProcessingYear();
                SetHeaderInformation();
                ProcessesStarFunctionality();

                ViewState["Adjust_Employee"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Found_Employee_Number", PLA_Approval.TrainingClass.ConnectionString);
                if (ViewState["Adjust_Employee"].ToString() != "")
                {
                    txtEmployeeName.Text = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Found_Name", PLA_Approval.TrainingClass.ConnectionString);
                    DrawGrid();
                }
            }
            if (ViewState["Adjust_Employee"].ToString() != "")
            {
                DrawGrid();
            }
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            lblScript.Text = "";
            #region BasTemplate
            if (!IsPostBack)
            {
                Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                try
                {
                    if (Request.Cookies["Session_ID"] == null)
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                    }
                    string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, true);
                    if (strResult != "")
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                        return;
                    }
                    objBasTemplate.SetSeatchField(0);
                    objBasTemplate.ShowNotes                  = false;
                    LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                    ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                    ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                    ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                    ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                    ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                    ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                    ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                    ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                    ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                    ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                    ViewState["Page_ID"]           = objBasTemplate.strPageId;
                    // Wizard
                    string strpnlXML = objBasTemplate.PanelXML();
                    if (strpnlXML != "")
                    {
                        if (strpnlXML.IndexOf("Error:") != -1)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                            return;
                        }
                        ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                        ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                        ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                        ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                        ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                        ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                        ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                        ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                        ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                        ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                        ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                        ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                        ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                        ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                        ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                        ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                        ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                        ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                        ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                        ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                        ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                    }
                }
                catch (Exception ex)
                {
                    string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                    Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                }
                finally
                {
                    objBasTemplate.CleanUp();
                    objBasTemplate.Dispose();
                }
            }
            #endregion
            //Bas_Utility.Utilities.SetPageFields(Page, ViewState["Page_ID"].ToString());
            if ((hidCommand.Value != null) && (hidCommand.Value == "DoSave"))
            {
                hidCommand.Value = "";
                CheckSave();
                //if (CheckSave())
                //    Response.Redirect(Request.Path);
                return;
            }
            if (!IsPostBack)
            {
                btnSave.Attributes.Add("onclick", "Do_Save()");
                Training_Source.TrainingClass.SetValidators(Page);
                ViewState["Employee_Number"] = Training_Source.TrainingClass.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
                //if (ViewState["User_Group_ID"].ToString()!="1")
                //{
                //    string strMesg = Training_Source.TrainingClass.IsEeDataOk(ViewState["Employee_Number"].ToString());
                //    if (strMesg!="")
                //        Response.Redirect("out.aspx?message="+strMesg,true);
                //}
                this.LblTemplateHeader2.Text = Template.BasTemplate.Update_Header(this.LblTemplateHeader2.Text, "Edit Mode");

                lblBalance.Text = Training_Source.TrainingClass.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", Training_Source.TrainingClass.ConnectioString);
                ViewState["AppStatus"]         = Training_Source.TrainingClass.ApplicationStatus(ViewState["Request_Record_ID"].ToString());
                SetHeaderInformation();
                FillData();
                SetInView();
                object   ob = SQLStatic.SQL.ExecScaler("select pkg_training.lastdateforapplications('" + ViewState["Account_Number"].ToString() + "') from dual", Training_Source.TrainingClass.ConnectioString);
                DateTime dtLimit;
                if (ob == null)
                {
                    dtLimit = Convert.ToDateTime(ob);
                }
                else
                {
                    dtLimit = Convert.ToDateTime(ob);
                }
                ob = null;
                PopCalendar1.To.Date = dtLimit;
                PopCalendar2.To.Date = dtLimit;
                HighLightKeyFields();
                lblScript.Text = "<script>EnableNavigation()</script>";
                ProcessesStarFunctionality();
                if (txtStartDate.Text == "")
                {
                    Training_Source.TrainingClass.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                }
                else
                {
                    Training_Source.TrainingClass.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), Convert.ToDateTime(txtStartDate.Text).Year.ToString());
                }
                if (!Training_Source.TrainingClass.Use2008Types_Needs(ViewState["Request_Record_ID"].ToString()))
                {
                    ViewState["NextStpUrl"] = "TrainingTypesAndNeeds.aspx";
                }
                SetupWizardMenu();
            }
            if (!(Request.Form["doSave"] == null || Request.Form["doSave"] == ""))
            {
                string strGoTo = Request.Form["doSave"].Replace("'", "");
                doSave.Value = "";
                this.Validate();
                if (this.IsValid)
                {
                    SaveCourseDateTime();
                    Response.Redirect(strGoTo);
                }
            }
            CheckHeaderIDSet();
            HandleContractors();
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Training_Source.TrainingClass.SessionHasTimeOut(Request.Cookies["Session_ID"].Value.ToString()))
            {
                Response.Redirect("/Web_Projects/trn/PLA/out.aspx?message=Your Session has timed out" + "&backurl=0", true);
            }
            lblError.Text = "";
            #region BasTemplate
            if (!IsPostBack)
            {
                Template.BasTemplate objBasTemplate = new Template.BasTemplate();
                try
                {
                    if (Request.Cookies["Session_ID"] == null)
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=Cookie not found. Please signon first", true);
                    }
                    string strResult = objBasTemplate.Authenticate(Request.Cookies["Session_ID"].Value.ToString(), Request.Url.Authority.ToString(), Request.Url.AbsolutePath.ToString(), true, true);
                    if (strResult != "")
                    {
                        Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strResult, false);
                        return;
                    }
                    objBasTemplate.SetSeatchField(0);
                    objBasTemplate.ShowNotes                  = false;
                    LblTemplateHeader2.Text                   = objBasTemplate.Header2();
                    ViewState["AccessType"]                   = objBasTemplate.strAccessType;
                    ViewState["Employee_Number"]              = objBasTemplate.strEmployee_Number;
                    ViewState["Processing_Year"]              = objBasTemplate.strProcessingYear;
                    ViewState["Role_Restriction_Level"]       = objBasTemplate.strRole_Restriction_Level;
                    ViewState["Selected_Account_Number"]      = objBasTemplate.strSelected_Account_Number;
                    ViewState["Selected_Employee_Class_Code"] = objBasTemplate.strSelected_Employee_Class_Code;
                    ViewState["User_Group_ID"]                = objBasTemplate.strUser_Group_ID;
                    ViewState["User_ID"]           = objBasTemplate.strUser_ID;
                    ViewState["User_Name"]         = objBasTemplate.strUser_Name;
                    ViewState["User_Primary_Role"] = objBasTemplate.strUser_Primary_Role;
                    // Wizard
                    string strpnlXML = objBasTemplate.PanelXML();
                    if (strpnlXML != "")
                    {
                        if (strpnlXML.IndexOf("Error:") != -1)
                        {
                            Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strpnlXML, true);
                            return;
                        }
                        ViewState["CurrGrp"]           = objBasTemplate.Wizard_Value("CurrGrp");
                        ViewState["CurrGrpTtl"]        = objBasTemplate.Wizard_Value("CurrGrpTtl");
                        ViewState["CurrGrpUrl"]        = objBasTemplate.Wizard_Value("CurrGrpUrl");
                        ViewState["CurrStp"]           = objBasTemplate.Wizard_Value("CurrStp");
                        ViewState["CurrStpTtl"]        = objBasTemplate.Wizard_Value("CurrStpTtl");
                        ViewState["CurrStpUrl"]        = objBasTemplate.Wizard_Value("CurrStpUrl");
                        ViewState["Is_Step_Completed"] = objBasTemplate.Wizard_Value("Is_Step_Completed");
                        ViewState["NextGrp"]           = objBasTemplate.Wizard_Value("NextGrp");
                        ViewState["NextGrpTtl"]        = objBasTemplate.Wizard_Value("NextGrpTtl");
                        ViewState["NextGrpUrl"]        = objBasTemplate.Wizard_Value("NextGrpUrl");
                        ViewState["NextStp"]           = objBasTemplate.Wizard_Value("NextStp");
                        ViewState["NextStpTtl"]        = objBasTemplate.Wizard_Value("NextStpTtl");
                        ViewState["NextStpUrl"]        = objBasTemplate.Wizard_Value("NextStpUrl");
                        ViewState["NoGrp"]             = objBasTemplate.Wizard_Value("NoGrp");
                        ViewState["NoStpInGrp"]        = objBasTemplate.Wizard_Value("NoStpInGrp");
                        ViewState["PrvGrp"]            = objBasTemplate.Wizard_Value("PrvGrp");
                        ViewState["PrvGrpTtl"]         = objBasTemplate.Wizard_Value("PrvGrpTtl");
                        ViewState["PrvGrpUrl"]         = objBasTemplate.Wizard_Value("PrvGrpUrl");
                        ViewState["PrvStp"]            = objBasTemplate.Wizard_Value("PrvStp");
                        ViewState["PrvStpTtl"]         = objBasTemplate.Wizard_Value("PrvStpTtl");
                        ViewState["PrvStpUrl"]         = objBasTemplate.Wizard_Value("PrvStpUrl");
                    }
                }
                catch (Exception ex)
                {
                    string strError = "Error Message: " + ex.Message + "~~Application:" + ex.Source + "~~Method:" + ex.TargetSite + "~~Detail:" + ex.StackTrace;
                    Response.Redirect("/web_projects/login_error/ErrorPage.aspx?error=" + strError.Replace("\n", "~"));
                }
                finally
                {
                    objBasTemplate.CleanUp();
                    objBasTemplate.Dispose();
                }
            }
            #endregion

            if (!IsPostBack)
            {
                Training_Source.TrainingClass.SetValidators(Page);
                ViewState["Employee_Number"] = Training_Source.TrainingClass.UsedEmployeeNumber2(ViewState["Employee_Number"].ToString(), Request.Cookies["Session_ID"].Value.ToString());
                //if (ViewState["User_Group_ID"].ToString()!="1")
                //{
                //    string strMesg = Training_Source.TrainingClass.IsEeDataOk(ViewState["Employee_Number"].ToString());
                //    if (strMesg!="")
                //        Response.Redirect("out.aspx?message="+strMesg,true);
                //}
                lblBalance.Text = Training_Source.TrainingClass.AvailableAmount(ViewState["Employee_Number"].ToString(), ViewState["Processing_Year"].ToString());
                ViewState["Request_Record_ID"] = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Request_Record_ID", Training_Source.TrainingClass.ConnectioString);
                if (ViewState["Request_Record_ID"].ToString() == "-1")
                {
                    lblScript.Text = "<script>alert('Vendor Information page must be completed first');window.location.href='TrainingVendorInfo.aspx';</script>";
                    return;
                }
                SQLStatic.Sessions.SetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Applicant_Employee_Number", ViewState["Employee_Number"].ToString(), Training_Source.TrainingClass.ConnectioString);
                SetHeaderInformation();
                ProcessesStarFunctionality();
                ShowCurrentSupervisor();
                if (SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "Reroute_Found_Employee_Number", Training_Source.TrainingClass.ConnectioString) != "")
                {
                    ReadNameAndNumber();
                }
                SetNavigation();
                string strProcessingYear = SQLStatic.Sessions.GetSessionValue(Request.Cookies["Session_ID"].Value.ToString(), "CoursePY", Training_Source.TrainingClass.ConnectioString);
                Training_Source.TrainingClass.FillBudgetYears(ddlBudgetYear, lblBalance, ViewState["Employee_Number"].ToString(), strProcessingYear);
                SetupWizardMenu();
                string strStatus = Training_Source.TrainingClass.ApplicationStatus(ViewState["Request_Record_ID"].ToString());
                if (Convert.ToInt16(strStatus) > 0)
                {
                    lblifo.Visible = true;
                }
                else
                {
                    lblifo.Visible = false;
                }
            }
            HandleContractors();
        }