protected void AddTManual_Click(object sender, EventArgs e)
        {
            Security objSecurity = new Security();
            string   strTPID     = string.Empty;
            string   strInstID   = string.Empty;

            try
            {
                strInstID = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                if (GlobalMethods.ValueIsNull(strInstID).Length > 0)
                {
                    strInstID = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                }

                #region Getting TPId using the InstructorId
                List <clsTP_Instructors> lstTPInst = new List <clsTP_Instructors>();
                lstTPInst = TP_InstructorsDAL.SelectDynamicTP_Instructors("InstructorId = " + strInstID + "", "TPId");
                if (lstTPInst != null)
                {
                    if (lstTPInst.Count > 0)
                    {
                        strTPID = lstTPInst[0].TPId.ToString();
                    }
                }
                #endregion

                #region "variables"
                string vTrainingCourseId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(dropCourses.SelectedItem.Value), AppConstants.secretKey, AppConstants.initVec).ToString();
                string vTPId             = strTPID;
                string vInstID           = strInstID;
                string vCName            = objSecurity.KillChars(txtCTitle.Text);
                //string vCDesc = objSecurity.KillChars(txtCDesc.Text);
                //string vStartDate = objSecurity.KillChars(txtStartDate.Text.ToString());
                //string vEndDate = objSecurity.KillChars(txtEndDate.Text.ToString());
                //string vRegistrationLimit = objSecurity.KillChars(txtRegisterLimit.Text);
                //string vExpectedEnrollment = objSecurity.KillChars(txtMinEnroll.Text);
                //string vCLanguage = dropLanguage.SelectedItem.Value;
                //string vDesc = objSecurity.KillChars(txtCDesc.Text.ToString());
                #endregion

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('You have successfully schedule a class!', '', 'success', 'Inst_ScheduleClass.aspx?desh=active&cgi=" + Request["cgi"] + "');", true);
            }
            catch (Exception)
            {
                ErrorHandler.ErrorPage();
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strTPID        = string.Empty;
                bool   boolInstVarify = false;

                try
                {
                    strTPID = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                    if (GlobalMethods.ValueIsNull(strTPID).Length > 0)
                    {
                        strTPID = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    }

                    #region Checking if this is AssignedToMe Action
                    bool IsAssignedToMe = false;
                    List <clsTP_Approval> lstContAppr = new List <clsTP_Approval>();
                    lstContAppr = TP_ApprovalDAL.SelectDynamicTP_Approval("TPId = " + strTPID + "", "MDETPApprId");
                    if (lstContAppr != null)
                    {
                        if (lstContAppr.Count > 0)
                        {
                            IsAssignedToMe = true;
                        }
                    }
                    #endregion

                    clsTrainingProvider objSPCont = new clsTrainingProvider();
                    objSPCont = TrainingProviderDAL.SelectTrainingProviderById(Convert.ToInt32(strTPID));
                    if (objSPCont != null)
                    {
                        #region Getting Contractor Info.
                        //clsSP_Contractor objSPC = new clsSP_Contractor();
                        //objSPC = SP_ContractorDAL.SelectSP_ContractorById(objSPCont.SPContractorID);
                        //if (objSPC != null)
                        //{
                        //    lblContractor.Text = objSPC.SPName;
                        //  //  lblCourseName.Text = "<b>" + objSPC.SPName + "</b>"; // for heading
                        //}
                        //else
                        //{
                        //    lblContractor.Text = "";
                        //   // lblCourseName.Text = "";
                        //}
                        #endregion

                        lblTPName.Text        = objSPCont.TP_Name;
                        lblContractorApp.Text = objSPCont.TP_Name;
                        //lblTPPhone.Text = objSPCont.TP_Phone;
                        //lblTPMobile.Text = objSPCont.TP_Mobile;
                        lblTPWebsite.Text = objSPCont.TP_WebSite;

                        List <clsTP_Instructors> lstTPIns = new List <clsTP_Instructors>();
                        lstTPIns = TP_InstructorsDAL.SelectDynamicTP_Instructors("TPId = " + objSPCont.TPId + "", "TP_InstructorsId");
                        if (lstTPIns != null)
                        {
                            if (lstTPIns.Count > 0)
                            {
                                clsInstructor objInstructorIs = new clsInstructor();
                                objInstructorIs = InstructorDAL.SelectInstructorById(lstTPIns[0].TP_InstructorListId);
                                if (objInstructorIs != null)
                                {
                                    //lblApprInsName.Text = objInstructorIs.Instructor_FName + " " + objInstructorIs.Instructor_LName;
                                    //lblApprInsAccNum.Text = objInstructorIs.Instructor_AcctId;
                                    //lblApprInsExpire.Text = objInstructorIs.Instructor_AcctExpire.ToShortDateString();

                                    lblInstructorName.Text = objInstructorIs.Instructor_FName + " " + objInstructorIs.Instructor_LName;
                                    lblInsAccId.Text       = objInstructorIs.NewRenewal_InspecTech_AcctNumber;
                                    lblAccdExpireDate.Text = objInstructorIs.NewRenewal_InspecTech_AcctExpiration;
                                }
                            }
                        }

                        List <clsTP_Location> lstLocation = new List <clsTP_Location>();
                        lstLocation = TP_LocationDAL.SelectDynamicTP_Location("TPId = " + objSPCont.TPId + "", "TPLocationId");
                        if (lstLocation != null)
                        {
                            if (lstLocation.Count > 0)
                            {
                                lblAddress_1.Text = lstLocation[0].TP_Address_Line_1;
                                lblAddress_2.Text = "";
                                lblCity.Text      = lstLocation[0].TP_City;
                                lblCounty.Text    = "";
                                lblState.Text     = lstLocation[0].TP_State;
                                lblZipCode.Text   = lstLocation[0].TP_ZipCode;
                                lblTPEmail.Text   = "";
                            }
                        }

                        //if(objSPCont.IsActive == 1)
                        //{
                        //    #region Approve Training Provider should Add Courses.
                        //    pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a class='btn btn-primary2' href='TP_AddCourses.aspx?dash=active&cgi="+ objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(objSPCont.TPId.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString() + "'  >Schedule Courses</a>" + GlobalMethods.ContractorAppStatus(objSPCont.IsActive, "bar") + "</div>"));
                        //    #endregion
                        //}
                        //else
                        //{
                        pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(objSPCont.IsActive.HasValue ? objSPCont.IsActive.Value : 0, "bar", "") + "</div>"));
                        // }
                    }
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strTPID = string.Empty;

                try
                {
                    strTPID = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                    if (GlobalMethods.ValueIsNull(strTPID).Length > 0)
                    {
                        strTPID = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    }

                    clsInstructor objSPCont = new clsInstructor();
                    objSPCont = InstructorDAL.SelectInstructorById(Convert.ToInt32(strTPID));
                    if (objSPCont != null)
                    {
                        List <clsTP_Instructors> lstTPIns = new List <clsTP_Instructors>();
                        lstTPIns = TP_InstructorsDAL.SelectDynamicTP_Instructors("InstructorId = " + strTPID + " and CreatedBy = '" + HttpContext.Current.Session["UserAuthId"].ToString() + "'", "TP_InstructorsId");
                        if (lstTPIns != null)
                        {
                            if (lstTPIns.Count > 0)
                            {
                                clsTrainingProvider objIns = new clsTrainingProvider();
                                objIns = TrainingProviderDAL.SelectTrainingProviderById(lstTPIns[0].TPId);
                                if (objIns != null)
                                {
                                    lblTP.Text            = objIns.TP_Name;
                                    lblInstructorAss.Text = " associated with " + objIns.TP_Name;
                                }
                                else
                                {
                                    lblTP.Text            = "-";
                                    lblInstructorAss.Text = "-";
                                }
                            }
                            else
                            {
                                lblTP.Text            = "NO TRAINING PROVIDER";
                                lblInstructorAss.Text = " NOT ASSOCIATED WITH TRAINING PROVIDER";
                            }
                        }
                        else
                        {
                            lblTP.Text            = "NO TRAINING PROVIDER";
                            lblInstructorAss.Text = " NOT ASSOCIATED WITH TRAINING PROVIDER";
                        }

                        #region Getting Category Title
                        clsCategory objCat = new clsCategory();
                        objCat = CategoryDAL.SelectCategoryById(objSPCont.ACRDCatID);
                        if (objCat != null)
                        {
                            lblCategory.Text = objCat.CatTitle;
                        }
                        else
                        {
                            lblCategory.Text = "-";
                        }
                        #endregion

                        lblFName.Text          = objSPCont.Instructor_FName;
                        lblLName.Text          = objSPCont.Instructor_LName;
                        lblInstructorApp.Text  = objSPCont.Instructor_FName + " " + objSPCont.Instructor_LName;
                        lblTPEmail.Text        = objSPCont.Instructor_Email;
                        lblTPPhone.Text        = objSPCont.Instructor_Phone;
                        lblTPMobile.Text       = "";
                        lblInsAccId.Text       = objSPCont.AccreditationID;
                        lblAccdExpireDate.Text = Convert.ToDateTime(objSPCont.AccreditationExpirationDate).ToShortDateString();


                        if (objSPCont.IsActive == 1)
                        {
                            pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a href='Inst_ScheduleClass.aspx?dash=active&cgi=" + Request["cgi"] + "' class='btn btn-primary2'>Schedule A Class</a>" + GlobalMethods.ContractorAppStatus(objSPCont.IsActive.HasValue ? objSPCont.IsActive.Value : -1, "bar", "") + "</div>"));
                        }
                        else
                        {
                            pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(objSPCont.IsActive.HasValue ? objSPCont.IsActive.Value : -1, "bar", "") + "</div>"));
                        }
                    }
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }