protected void AddTManual_Click(object sender, EventArgs e) { Security objSecurity = new Security(); #region Address 1 string vTPID = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(dropTPs.SelectedItem.Value), AppConstants.secretKey, AppConstants.initVec).ToString(); string vAddress_1 = objSecurity.KillChars(txtAddress_1.Text); // string vAddress_2 = objSecurity.KillChars(txtAddress_2.Text); string vCity = objSecurity.KillChars(txtCity.Text); // string vCounty = objSecurity.KillChars(txtCounty.Text); string vState = objSecurity.KillChars(txtState.Text); string vZipCode = objSecurity.KillChars(txtZipCode.Text); #endregion #region Now saving Location clsTP_Location objTPLoc = new clsTP_Location(); objTPLoc.TPId = Convert.ToInt32(vTPID); objTPLoc.TP_Address_Line_1 = vAddress_1; //objTPLoc.TP_Address_Line_2 = vAddress_2; objTPLoc.TP_City = vCity; objTPLoc.TP_State = vState; //objTPLoc.TP_County = vCounty; objTPLoc.TP_ZipCode = vZipCode; //objTPLoc.Location_Email = ""; if (!TP_LocationDAL.InsertTP_Location(objTPLoc)) { } #endregion ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Location Added successfully!', '', 'success', 'TP_AddLocations.aspx?desh=active');", true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strInstID = string.Empty; string strTPID = string.Empty; string strLocation = string.Empty; try { #region Showing all the Courses added to the list. List <clsCourseSchedule> lstCS = new List <clsCourseSchedule>(); lstCS = CourseScheduleDAL.SelectDynamicCourseSchedule("(CAST(StartDate AS Date) >= CAST('" + Convert.ToDateTime(DateTime.Now).ToShortDateString() + "' AS Date))", "TrainingCourseScheduleId"); if (lstCS != null) { if (lstCS.Count > 0) { for (int i = 0; i < lstCS.Count; i++) { clsTP_Location objLoc = new clsTP_Location(); objLoc = TP_LocationDAL.SelectTP_LocationById(lstCS[i].TPLocationId); if (objLoc != null) { strLocation = ""; } showTable(pnlVideos, GlobalMethods.ValueIsNull(lstCS[i].ClassTitle), GlobalMethods.ValueIsNull(lstCS[i].StartDate) + " - " + GlobalMethods.ValueIsNull(lstCS[i].EndDate), GlobalMethods.ValueIsNull(lstCS[i].InstructionLanguage), GlobalMethods.ValueIsNull(lstCS[i].RegistrationLimit), GlobalMethods.ValueIsNull(lstCS[i].ExpectedEnrollment), GlobalMethods.ValueIsNull(strLocation), GlobalMethods.ValueIsNull(lstCS[i].CreateDate), Convert.ToInt32(GlobalMethods.ValueIsNull(lstCS[i].TrainingCourseScheduleId))); } } } #endregion } catch (Exception) { ErrorHandler.ErrorPage(); } } }
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) { string strTPId = string.Empty; if (!IsPostBack) { #region Getting approved Training Provider list List <clsTrainingProvider> lstTPs = new List <clsTrainingProvider>(); lstTPs = TrainingProviderDAL.SelectDynamicTrainingProvider("(IsActive = 1) and (CreatedBy = '" + HttpContext.Current.Session["UserAuthId"].ToString() + "')", "TPId"); if (lstTPs != null) { if (lstTPs.Count > 0) { dropTPs.Items.Add(new ListItem( String.Format("{0}", SQLHelper.TrimAndReplaceEOF("Select a Training Provider")), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(objcryptoJS.AES_encrypt("0".ToString(), AppConstants.secretKey, AppConstants.initVec).ToString())))); for (int i = 0; i < lstTPs.Count; i++) { dropTPs.Items.Add(new ListItem( String.Format("{0}", SQLHelper.TrimAndReplaceEOF(lstTPs[i].TP_Name.ToString())), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(objcryptoJS.AES_encrypt(lstTPs[i].TPId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString())))); } } } #endregion #region Getting TPId using AuthUserId List <dynamic> lstTPValues; string strSQLTP = @"SELECT tbl_User.AuthorisedUserId, tbl_User.FName, tbl_User.LName, tbl_User.Password, tbl_User.TempPassword, tbl_User.salt, tbl_User.EmailId, tbl_User.IsCurrent, tbl_User.IndividualUserID, tbl_User.CreatedDate, tbl_User.CreatedBy, tbl_User.UpdatedDate, tbl_User.UpdatedBy, tbl_User.Notes, tbl_User.ImageURL, tbl_User.IsAdmin, tbl_User.IsActive, tbl_UserRole.RoleId, tbl_TrainingProvider.TP_Name, tbl_TrainingProvider.TPId FROM tbl_User INNER JOIN tbl_UserRole ON tbl_User.AuthorisedUserId = tbl_UserRole.AuthorizedUserId INNER JOIN tbl_TrainingProvider ON tbl_User.AuthorisedUserId = tbl_TrainingProvider.CreatedBy WHERE (tbl_User.AuthorisedUserId = @UserId) AND (tbl_UserRole.RoleId = 2)"; var objParTP = new DynamicParameters(); objParTP.Add("@UserId", Convert.ToInt32(HttpContext.Current.Session["UserAuthId"].ToString()), DbType.Int32); try { using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"])) { lstTPValues = db.Query <dynamic>(strSQLTP, objParTP, commandType: CommandType.Text).ToList(); if (lstTPValues != null) { if (lstTPValues.Count > 0) { strTPId = GlobalMethods.ValueIsNull(lstTPValues[0].TPId); } } } } catch (Exception ex) { ErrorHandler.ErrorLogging(ex, false); ErrorHandler.ReadError(); } #endregion #region Getting list of locations List <clsTP_Location> lstLocations = new List <clsTP_Location>(); lstLocations = TP_LocationDAL.SelectDynamicTP_Location("TPId = " + strTPId + "", "TPId"); if (lstLocations != null) { if (lstLocations.Count > 0) { for (int i = 0; i < lstLocations.Count; i++) { showTable(pnlVideos, GlobalMethods.ValueIsNull(lstLocations[i].TP_Address_Line_1), GlobalMethods.ValueIsNull(lstLocations[i].TP_City), GlobalMethods.ValueIsNull(lstLocations[i].TP_State), GlobalMethods.ValueIsNull(lstLocations[i].TP_ZipCode)); } } } #endregion } }