protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strtcId = string.Empty; phWriteComment.Visible = false; strtcId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString(); if (GlobalMethods.ValueIsNull(strtcId).Length > 0) { strtcId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString(); } #region Checking if this is AssignedToMe Action bool IsAssignedToMe = false; var pendingApps = _tcRepository.PendingApps(); if (pendingApps.Select(x => x.Id).Contains(Convert.ToInt32(strtcId))) { // Means this needs Assigned To Me button. IsAssignedToMe = true; phWriteComment.Visible = false; } #endregion var obj = _tcRepository.Get(int.Parse(strtcId)); if (obj != null) { //txtLName.Text = obj.InspectorLastName; //txtSuffix.Text = obj.Suffix; //txtFName.Text = obj.InspectorFirstName; //txtMName.Text = obj.InspectorMiddleName; //lblContractorApp.Text = obj.InspectorFirstName + " " + obj.InspectorLastName; ; //txtAddress_1.Text = obj.InspectorContractor_Address_Line_1; //txtCity_1.Text = obj.InspectorContractor_City; //txtState_1.Text = obj.InspectorContractor_State; //txtZipCode_1.Text = obj.InspectorContractor_ZipCode; //txtAddress_2.Text = obj.InspectorContractor_Address_Line_2; //txtCity_2.Text = obj.InspectorContractor_City_2; //txtState_2.Text = obj.InspectorContractor_State_2; //txtZipcode_2.Text = obj.InspectorContractor_ZipCode_2; //txtPhone.Text = obj.InspectorPhone; //txtEmailAddress.Text = obj.InspectorEmail; //txtDOB.Text = obj.InspectorDOB.FromByteArray(); //txtSSNO.Text = obj.InspectorSSN.FromByteArray(); //txtACCID.Text = obj.AccreditationID; //txtAccreditationExpirationDate.Text = obj.AccreditationExpirationDate.HasValue ? obj.AccreditationExpirationDate.Value.ToShortDateString() : ""; //txtThirdPartyInspTechExamDate.Text = obj.ThirdPartyExamDate.HasValue ? obj.ThirdPartyExamDate.Value.ToShortDateString() : ""; //txtThirdPartyRiskAssExamDate.Text = obj.ThirdPartyExamDate.HasValue ? obj.ThirdPartyExamDate.Value.ToShortDateString() : ""; //txtMinEx_Start.Text = obj.OneYearMinExperience_Start.HasValue ? obj.OneYearMinExperience_Start.Value.ToShortDateString() : ""; //txtMinEx_End.Text = obj.OneYearMinExperience_End.HasValue ? obj.OneYearMinExperience_End.Value.ToShortDateString() : ""; ; //txtInTechAccred.Text = obj.InspectorTechAccreditationId; //chkWaiver.Checked = obj.Waiver == 1; //txtTrainingCardNum.Text = obj.CourseTrainingCardNum; //txtTrainCExpire.Text = obj.CourseExpirationDate; //txtTrainingProviderName.Text = obj.CourseTPName; //txtCourseName.Text = obj.CourseName; //txtCourseStartDate.Text = obj.CourseStartDate.HasValue ? obj.CourseStartDate.Value.ToShortDateString() : ""; //txtCourseEndDate.Text = obj.CourseEndDate.HasValue ? obj.CourseEndDate.Value.ToShortDateString() : ""; //txtContractorName.Text = obj.InspectorContractorName; //txtContractorAccdNum.Text = obj.InspectorContractorAcctNum; //txtIC_Address_Line_1.Text = obj.InspectorContractor_Address_Line_1; //txtIC_City.Text = obj.InspectorContractor_City; //txtIC_State.Text = obj.InspectorContractor_State; //txtIC_Zipcode.Text = obj.InspectorContractor_ZipCode; //txtICContactFName.Text = obj.InspectorContactFirstName; //txtICContactLName.Text = obj.InspectorContactLastName; //lblContactInfo.Text = obj.InspectorContactFirstName + " " + obj.InspectorContactLastName + " / " + obj.InspectorPhone; //lblDateSigned.Text = obj.CreatedDate.ToLongDateString(); //var url = obj.RiskAssessorExperi_URL.Split('\\'); //if (url[0].Length > 0) //{ // lkupload.Text = url[1]; // lkupload.NavigateUrl = objcryptoJS.AES_encrypt(Path.GetFileNameWithoutExtension(url[1]), AppConstants.secretKey, AppConstants.initVec) + Path.GetExtension(obj.RiskAssessorExperi_URL); //} //chkIAgree.Checked = obj.Agreed == 1; //dropIsRenewal.SelectedValue = obj.IsRenewal.HasValue ? obj.IsRenewal.Value.ToString() : "-1"; //if ((dropIsRenewal.SelectedValue == "0") || (dropIsRenewal.SelectedValue == "-1")) //{ // divIsRenewal.Visible = false; //} //dropCategory.SelectedValue = obj.ACRDCatID.ToString(); //if (obj.ACRDCatID == Category.VisualInspector) //{ // divCatInspection.Visible = true; //} //if (obj.ACRDCatID == Category.InspectorTechnician) //{ // divCatResidential.Visible = true; //} //if (obj.ACRDCatID == Category.RiskAccesor) //{ // divCatSteel.Visible = true; //} } string strEnContractId = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(obj.Id.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString(); if (IsAssignedToMe) { pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a class='btn btn-primary2 open-AssignedToMe' href='#' data-id='" + strEnContractId + "' data-toggle='modal' >Assigned to Me</a>" + GlobalMethods.ContractorAppStatus(obj.IsActive.HasValue ? obj.IsActive.Value : 0, "bar", "") + "</div>")); } else { pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a class='btn btn-success open-Approve' title='Approve Application' href='#' data-id='" + strEnContractId + "' data-toggle='modal' >Approve</a> <a class='btn btn-danger open-Disapprove' href='#' title='Reject Application' data-id='" + strEnContractId + "' data-toggle='modal' >Reject</a> <a class='btn btn-danger2 open-Hold' href='#' title='Put Application On Hold' data-id='" + strEnContractId + "' data-toggle='modal' >On Hold</a> <a class='btn btn-warning open-Deficient' href='#' title='Application status is Deficient' data-id='" + strEnContractId + "' data-toggle='modal' >Deficient</a>" + GlobalMethods.ContractorAppStatus(obj.IsActive.HasValue ? obj.IsActive.Value : 0, "bar", "") + "</div>")); } #region Disabling all controls. GlobalMethods.DisableControls(this.Page); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTrainingCourseAppId = string.Empty; phWriteComment.Visible = false; strTrainingCourseAppId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString(); if (GlobalMethods.ValueIsNull(strTrainingCourseAppId).Length > 0) { strTrainingCourseAppId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString(); } #region Getting all the Comments by Application Id. StringBuilder strMessenger = new StringBuilder(""); List <clsTrainingCourse_Comment> lstComments = new List <clsTrainingCourse_Comment>(); lstComments = TrainingCourse_CommentDAL.SelectDynamicTrainingCourse_Comment("TrainingCourseAppId = " + strTrainingCourseAppId + "", "TrainingCourseCommentId"); if (lstComments != null) { if (lstComments.Count > 0) { for (int i = 0; i < lstComments.Count; i++) { strMessenger.Append(GlobalMethods.Messenger(lstComments[i].CreatedBy.ToString(), Convert.ToDateTime(lstComments[i].CreatedDate).ToLongDateString(), lstComments[i].Comment.ToString()).ToString()); } } } pnlComments.Controls.Add(new LiteralControl(strMessenger.ToString())); #endregion #region Checking if this is AssignedToMe Action bool IsAssignedToMe = false; var pendingApps = _tcRepository.PendingApps(); if (pendingApps.Select(x => x.Id).Contains(Convert.ToInt32(strTrainingCourseAppId))) { // Means this needs Assigned To Me button. IsAssignedToMe = true; phWriteComment.Visible = false; } #endregion var obj = _tcRepository.Get(int.Parse(strTrainingCourseAppId)); if (obj != null) { txtTPName.Text = obj.TrainingProviderName; txtAddress_1.Text = obj.TP_Address_Line_1; txtCity_1.Text = obj.TP_City; txtState_1.Text = obj.TP_State; txtZipCode_1.Text = obj.TP_ZipCode; txtAddress_2.Text = obj.TP_Address_Line_2; txtCity_2.Text = obj.TP_City_2; txtState_2.Text = obj.TP_State_2; txtZipcode_2.Text = obj.TP_Zipcode_2; txtPhone.Text = obj.TP_Telephone; txtFax.Text = obj.TP_Fax; txtEmailAddress.Text = obj.TP_Email; txtSSN.Text = obj.TP_TaxID.FromByteArray(); chkIAgree.Checked = obj.Agreed == 1; //dropIsRenewal.SelectedValue = obj.IsRenewal.HasValue ? obj.IsRenewal.Value.ToString() : "-1"; if ((dropIsRenewal.SelectedValue == "0") || (dropIsRenewal.SelectedValue == "-1")) { divIsRenewal.Visible = false; } txtACCID.Text = obj.AccreditationID; txtAccreditationExpirationDate.Text = obj.AccreditationExpirationDate.HasValue ? obj.AccreditationExpirationDate.Value.ToShortDateString() : ""; chkRiskAssessor.Checked = obj.TC_RiskAssessor == 1; chkInspectorTech.Checked = obj.TC_InspectorTech == 1; chkVisualInspector.Checked = obj.TC_VisualInspector == 1; chkMainRepaint.Checked = obj.TC_Main_Repair == 1; chkRemoval.Checked = obj.TC_Removal == 1; chkProjectDesign.Checked = obj.TC_ProjectDesign == 1; chkAbatmentEnglish.Checked = obj.TC_AbatementWorkerEnglish == 1; chkAbatmentSpanish.Checked = obj.TC_AbatementWorkerSpanish == 1; chkStructSteelSuper.Checked = obj.TC_StructSteelSuper == 1; chkStructSteelWorker.Checked = obj.TC_StructSteelWorker == 1; hlnkUpload_1.NavigateUrl = obj.DocURL_1; hlnkUpload_2.NavigateUrl = obj.DocURL_2; hlnkUpload_3.NavigateUrl = obj.DocURL_3; hlnkUpload_4.NavigateUrl = obj.DocURL_4; hlnkUpload_5.NavigateUrl = obj.DocURL_5; txtAuthRepContFName.Text = obj.TPContactFirstName; txtAuthRepContLName.Text = obj.TPContactLastName; txtAuthRepContTitle.Text = obj.TPContactTitle; chkIAgree.Checked = obj.Agreed == 1; lblDateSigned.Text = obj.CreatedDate.ToShortDateString(); lblSignedBy.Text = obj.TPContactFirstName + " " + obj.TPContactLastName; #region Getting all the Case files. StringBuilder strMessengerUpload = new StringBuilder(""); foreach (var each in obj.Files.OrderByDescending(x => x.Id)) { strMessengerUpload.Append(GlobalMethods.UploadedFiles(each.CreatedBy.ToString(), Convert.ToDateTime(each.CreatedDate).ToLongDateString(), each.FileLocation.ToString()).ToString()); } pnlUploads.Controls.Add(new LiteralControl(strMessengerUpload.ToString())); #endregion } string strEnContractId = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(obj.Id.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString(); if (IsAssignedToMe) { GlobalMethods.DisableControls(this.Page); btnAddCourse.Visible = false; pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a class='btn btn-primary2 open-AssignedToMe' href='#' data-id='" + strEnContractId + "' data-toggle='modal' >Assigned to Me</a>" + GlobalMethods.ContractorAppStatus(obj.IsActive.HasValue ? obj.IsActive.Value : 0, "bar", "") + "</div>")); } else { phWriteComment.Visible = true; pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a class='btn btn-success open-Approve' title='Approve Application' href='#' data-id='" + strEnContractId + "' data-toggle='modal' >Approve</a> <a class='btn btn-danger open-Disapprove' href='#' title='Reject Application' data-id='" + strEnContractId + "' data-toggle='modal' >Reject</a> <a class='btn btn-primary open-Hold' href='#' title='Put Application On Hold' data-id='" + strEnContractId + "' data-toggle='modal' >On Hold</a> <a class='btn btn-primary open-Deficient' href='#' title='Application status is Deficient' data-id='" + strEnContractId + "' data-toggle='modal' >Deficient</a>" + GlobalMethods.ContractorAppStatus(obj.IsActive.HasValue ? obj.IsActive.Value : 0, "bar", "") + "</div>")); } #region Making all the fields disabled. GlobalMethods.DisableControl_CheckBoxByID(chkIAgree); GlobalMethods.DisableControl_DropDownByID(dropIsRenewal); #endregion } }