コード例 #1
0
        protected void CommentEnter(object sender, EventArgs e)
        {
            string strInstructorId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();

            if (GlobalMethods.ValueIsNull(strInstructorId).Length > 0)
            {
                strInstructorId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
            }
            else
            {
                ErrorHandler.ErrorPage();
            }

            clsInstructor_Comment objComm = new clsInstructor_Comment();

            objComm.InstructorId = Convert.ToInt32(strInstructorId);
            objComm.Comment      = GlobalMethods.KillChars(txtComment.Text);
            objComm.CreatedDate  = DateTime.Now;
            objComm.CreatedBy    = HttpContext.Current.Session["UserAuthId"].ToString();
            objComm.IsActive     = 1;
            if (!Instructor_CommentDAL.InsertInstructor_Comment(objComm))
            {
            }

            #region Getting all the Comments by Application Id.
            StringBuilder strMessenger = new StringBuilder("");
            List <clsInstructor_Comment> lstComments = new List <clsInstructor_Comment>();
            lstComments = Instructor_CommentDAL.SelectDynamicInstructor_Comment("InstructorId = " + strInstructorId + "", "InstructorCommentId");
            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
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strInstructorId = string.Empty;
                phWriteComment.Visible = false;

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

                #region Category Dropdown
                List <clsCategory> lstCategory = new List <clsCategory>();
                lstCategory = CategoryDAL.SelectDynamicCategory("(ACRDCategory = 'Instructor Accreditations')", "ACRDCatID");
                if (lstCategory != null)
                {
                    if (lstCategory.Count > 0)
                    {
                        dropInstructCategory.Items.Add(new ListItem(
                                                           String.Format("{0}", SQLHelper.TrimAndReplaceEOF("Select a Category")), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(objcryptoJS.AES_encrypt("0".ToString(), AppConstants.secretKey, AppConstants.initVec).ToString()))));
                        for (int i = 0; i < lstCategory.Count; i++)
                        {
                            dropInstructCategory.Items.Add(new ListItem(
                                                               String.Format("{0}", SQLHelper.TrimAndReplaceEOF(lstCategory[i].CatTitle.ToString())), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(lstCategory[i].ACRDCatID.ToString()))));
                            // String.Format("{0}", SQLHelper.TrimAndReplaceEOF(lstCategory[i].CatTitle.ToString())), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(objcryptoJS.AES_encrypt(lstCategory[i].ACRDCatID.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString()))));
                        }
                    }
                }
                #endregion


                #region Getting all the Comments by Application Id.
                StringBuilder strMessenger = new StringBuilder("");
                List <clsInstructor_Comment> lstComments = new List <clsInstructor_Comment>();
                lstComments = Instructor_CommentDAL.SelectDynamicInstructor_Comment("InstructorId = " + strInstructorId + "", "InstructorCommentId");
                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 = _instructorRepository.PendingApps();

                if (pendingApps.Select(x => x.Id).Contains(Convert.ToInt32(strInstructorId)))
                {
                    // Means this needs Assigned To Me button.
                    IsAssignedToMe         = true;
                    phWriteComment.Visible = false;
                }

                #endregion

                var obj = _instructorRepository.Get(int.Parse(strInstructorId));
                if (obj != null)
                {
                    lblContractorApp.Text = obj.Instructor_FName + " " + obj.Instructor_LName;
                    lblContactInfo.Text   = obj.TP_Contact_FName + " " + obj.TP_Contact_LName + " / " + obj.Instructor_Phone;

                    txtLName.Text                       = obj.Instructor_LName;
                    txtSuffix.Text                      = obj.Instructor_Suffix;
                    txtFName.Text                       = obj.Instructor_FName;
                    txtMName.Text                       = obj.Instructor_MName;
                    txtAddress_1.Text                   = obj.Instructor_Address_Line_1;
                    txtCity_1.Text                      = obj.Instructor_City;
                    txtState_1.Text                     = obj.Instructor_State;
                    txtZipCode_1.Text                   = obj.Instructor_ZipCode;
                    txtAddress_2.Text                   = obj.Instructor_Address_Line_2;
                    txtCity_2.Text                      = obj.Instructor_City_2;
                    txtState_2.Text                     = obj.Instructor_State_2;
                    txtZipcode_2.Text                   = obj.Instructor_ZipCode_2;
                    txtPhone.Text                       = obj.Instructor_Phone;
                    txtEmailAddress.Text                = obj.Instructor_Email;
                    txtDOB.Text                         = obj.Instructor_DOB.FromByteArray();
                    txtSSNO.Text                        = obj.Instructor_SSN.FromByteArray();
                    txtInstructTP.Text                  = obj.TP_Name;
                    txtInstructAcctNum.Text             = obj.TP_AcctNumber;
                    txtInstructContFN.Text              = obj.TP_Contact_FName;
                    txtInstructContLN.Text              = obj.TP_Contact_LName;
                    txtInstructContPhone.Text           = obj.TP_Telephone;
                    txtInstructContAddress.Text         = obj.TP_Address_Line_1;
                    txtInstructContCity.Text            = obj.TP_City;
                    txtInstructContState.Text           = obj.TP_State;
                    txtInstructContZipcode.Text         = obj.TP_ZipCode;
                    txtACCID.Text                       = obj.AccreditationID;
                    txtAccreditationExpirationDate.Text = obj.AccreditationExpirationDate.HasValue ? obj.AccreditationExpirationDate.Value.ToShortDateString() : "";
                    txtNewInitTrainingCard.Text         = obj.NewInitialTCard;
                    txtNewInitStartDate.Text            = obj.NewIT_StartDates.HasValue ? obj.NewIT_StartDates.Value.ToShortDateString() : "";
                    txtNewInitEndDate.Text              = obj.NewIT_EndDates.HasValue ? obj.NewIT_EndDates.Value.ToShortDateString() : "";
                    txtRenewalTrainingCard.Text         = obj.RenewalTCard;
                    txtRenewalStartDate.Text            = obj.RenewalLT_StartDates.HasValue ? obj.RenewalLT_StartDates.Value.ToShortDateString() : "";
                    txtRenewalEndDate.Text              = obj.RenewalLT_EndDates.HasValue ? obj.RenewalLT_EndDates.Value.ToShortDateString() : "";
                    if (obj.NewInstructors_URL != null)
                    {
                        var url = obj.NewInstructors_URL.Split('\\')[1];
                        lkuploadNewInstructors.Text        = url;
                        lkuploadNewInstructors.NavigateUrl = obj.NewInstructors_URL;
                    }
                    txtNewRenewAcctNum.Text        = obj.NewRenewal_InspecTech_AcctNumber;
                    txtNewRenewAcctExpireDate.Text = obj.NewRenewal_InspecTech_AcctExpiration;
                    if (obj.NewInspectorTechnInstructors_URL != null)
                    {
                        var url = obj.NewInspectorTechnInstructors_URL.Split('\\')[1];
                        lkuploadNewInspectorTech.Text        = url;
                        lkuploadNewInspectorTech.NavigateUrl = obj.NewInspectorTechnInstructors_URL;
                    }
                    chkIAgree.Checked                  = obj.Agreed == 1;
                    lblSignedBy.Text                   = obj.Instructor_FName + " " + obj.Instructor_LName;
                    lblDateSigned.Text                 = Convert.ToDateTime(obj.CreatedDate).ToLongDateString();
                    dropIsRenewal.SelectedValue        = obj.IsRenewal.ToString();
                    dropInstructCategory.SelectedValue = obj.ACRDCatID.ToString();

                    #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>&nbsp;<a class='btn btn-danger open-Disapprove' href='#' title='Reject Application' data-id='" + strEnContractId + "' data-toggle='modal' >Reject</a>&nbsp;<a class='btn btn-primary open-Hold' href='#' title='Put Application On Hold' data-id='" + strEnContractId + "' data-toggle='modal' >On Hold</a>&nbsp;<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", "MDE_InstructorApps.aspx?InstructApps=active") + "</div>"));
                }

                #region Making all the fields disabled.
                GlobalMethods.DisableControl_CheckBoxByID(chkIAgree);
                GlobalMethods.DisableControl_DropDownByID(dropInstructCategory);
                GlobalMethods.DisableControl_DropDownByID(dropIsRenewal);
                #endregion
            }
        }