예제 #1
0
        protected void CommentEnter(object sender, EventArgs e)
        {
            string strSupervisorId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();

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

            clsSupervisor_Comment objComm = new clsSupervisor_Comment();

            objComm.SupervisorId = Convert.ToInt32(strSupervisorId);
            objComm.Comment      = GlobalMethods.KillChars(txtComment.Text);
            objComm.CreatedDate  = DateTime.Now;
            objComm.CreatedBy    = HttpContext.Current.Session["UserAuthId"].ToString();
            objComm.IsActive     = 1;
            if (!Supervisor_CommentDAL.InsertSupervisor_Comment(objComm))
            {
            }

            #region Getting all the Comments by Application Id.
            StringBuilder strMessenger = new StringBuilder("");
            List <clsSupervisor_Comment> lstComments = new List <clsSupervisor_Comment>();
            lstComments = Supervisor_CommentDAL.SelectDynamicSupervisor_Comment("SupervisorId = " + strSupervisorId + "", "SupervisorCommentId");
            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 strSupervisorId = string.Empty;
                phWriteComment.Visible = false;

                strSupervisorId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                if (GlobalMethods.ValueIsNull(strSupervisorId).Length > 0)
                {
                    strSupervisorId = 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 <clsSupervisor_Comment> lstComments = new List <clsSupervisor_Comment>();
                lstComments = Supervisor_CommentDAL.SelectDynamicSupervisor_Comment("SupervisorId = " + strSupervisorId + "", "SupervisorCommentId");
                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 = _SupervisorRepository.PendingApps();

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

                #endregion

                var obj = _SupervisorRepository.Get(int.Parse(strSupervisorId));
                if (obj != null)
                {
                    lblContractorApp.Text = obj.SupervisorFirstName + " " + obj.SupervisorLastName;
                    lblSignedBy.Text      = obj.SupervisorFirstName + " " + obj.SupervisorLastName;
                    txtLName.Text         = obj.SupervisorLastName;
                    txtSuffix.Text        = obj.SupervisorSuffix;
                    txtFName.Text         = obj.SupervisorFirstName;
                    txtMName.Text         = obj.SupervisorMiddleName;
                    txtAddress_1.Text     = obj.Supervisor_Address_Line_1;
                    txtCity_1.Text        = obj.Supervisor_City;
                    txtState_1.Text       = obj.Supervisor_State;
                    txtZipCode_1.Text     = obj.Supervisor_ZipCode;
                    txtAddress_2.Text     = obj.Supervisor_Address_Line_2;
                    txtCity_2.Text        = obj.Supervisor_City_2;
                    txtState_2.Text       = obj.Supervisor_State_2;
                    txtZipcode_2.Text     = obj.Supervisor_ZipCode_2;
                    txtPhone.Text         = obj.SupervisorPhone;
                    txtEmailAddress.Text  = obj.SupervisorEmail;
                    txtDOB.Text           = obj.SupervisorDOB.FromByteArray();
                    txtSSNO.Text          = obj.SupervisorSSN.FromByteArray();
                    txtACCID.Text         = obj.AccreditationID;

                    divCatInspection.Visible  = obj.ACRDCatID == Category.StructuralSteelSupervisor;
                    divCatResidential.Visible = obj.ACRDCatID == Category.RemovalAndDemolition;
                    divCatSteel.Visible       = obj.ACRDCatID == Category.MaintananceAndRepainting;

                    if ((divCatResidential.Visible))
                    {
                        var i          = 0;
                        var strContent = new StringBuilder();

                        txtThirdPartyRemovalDate.Text      = obj.ThirdPartyExamDate.HasValue ? obj.ThirdPartyExamDate.Value.ToShortDateString() : "";
                        txtConstTradeRemovalStartDate.Text = obj.TwoYearMinExperience_Start.HasValue ? obj.TwoYearMinExperience_Start.Value.ToShortDateString() : "";
                        txtConstTradeRemovalEndDate.Text   = obj.TwoYearMinExperience_End.HasValue ? obj.TwoYearMinExperience_End.Value.ToShortDateString() : "";
                        txtRemovalSuperWorkedFor.Text      = obj.EmployerNames;
                        foreach (var each in obj.SupervisorExperiences)
                        {
                            if (i % 4 == 0)
                            {
                                strContent.Append("<div class='row'>");
                                GenerateCheckBox(pnlRemovalExperiences, each.Experience.ExperienceTitle.ToString());
                                if (i == 4)
                                {
                                    strContent.Append("</div>");
                                }
                            }
                            else
                            {
                                GenerateCheckBox(pnlRemovalExperiences, each.Experience.ExperienceTitle.ToString());
                            }
                            i++;
                        }
                    }

                    if (divCatInspection.Visible)
                    {
                        var i          = 0;
                        var strContent = new StringBuilder();
                        txtConstTradeSteelStartDate.Text = obj.TwoYearMinExperience_Start.HasValue ? obj.TwoYearMinExperience_Start.Value.ToShortDateString() : "";
                        txtConstTradeSteelEndDate.Text   = obj.TwoYearMinExperience_End.HasValue ? obj.TwoYearMinExperience_End.Value.ToShortDateString() : "";
                        txtSteelSuperWorkedFor.Text      = obj.EmployerNames;
                        foreach (var each in obj.SupervisorExperiences)
                        {
                            if (i % 4 == 0)
                            {
                                strContent.Append("<div class='row'>");
                                GenerateCheckBox(pnlSteelExperiences, each.Experience.ExperienceTitle.ToString());
                                if (i == 4)
                                {
                                    strContent.Append("</div>");
                                }
                            }
                            else
                            {
                                GenerateCheckBox(pnlSteelExperiences, each.Experience.ExperienceTitle.ToString());
                            }
                            i++;
                        }
                    }

                    if (divCatSteel.Visible)
                    {
                        var i          = 0;
                        var strContent = new StringBuilder();
                        txtThirdPartyRemovalDate.Text      = obj.ThirdPartyExamDate.HasValue ? obj.ThirdPartyExamDate.Value.ToShortDateString() : "";
                        txtConstTradeRemovalStartDate.Text = obj.TwoYearMinExperience_Start.HasValue ? obj.TwoYearMinExperience_Start.Value.ToShortDateString() : "";
                        txtConstTradeRemovalEndDate.Text   = obj.TwoYearMinExperience_End.HasValue ? obj.TwoYearMinExperience_End.Value.ToShortDateString() : "";
                        txtRemovalSuperWorkedFor.Text      = obj.EmployerNames;
                        foreach (var each in obj.SupervisorExperiences)
                        {
                            if (i % 4 == 0)
                            {
                                strContent.Append("<div class='row'>");
                                GenerateCheckBox(pnlRepaintExperiences, each.Experience.ExperienceTitle.ToString());
                                if (i == 4)
                                {
                                    strContent.Append("</div>");
                                }
                            }
                            else
                            {
                                GenerateCheckBox(pnlRepaintExperiences, each.Experience.ExperienceTitle.ToString());
                            }
                            i++;
                        }
                    }

                    txtAccreditationExpirationDate.Text = obj.AccreditationExpirationDate.HasValue ? Convert.ToDateTime(obj.AccreditationExpirationDate.ToString()).ToShortDateString() : "";
                    txtConstTradeSteelStartDate.Text    = obj.TwoYearMinExperience_Start.HasValue ? Convert.ToDateTime(obj.TwoYearMinExperience_Start.ToString()).ToShortDateString() : "";
                    txtConstTradeSteelEndDate.Text      = obj.TwoYearMinExperience_End.HasValue ? Convert.ToDateTime(obj.TwoYearMinExperience_End.ToString()).ToShortDateString() : "";
                    txtSteelSuperWorkedFor.Text         = obj.EmployerNames;
                    //txtThirdPartyRemovalDate.Text = obj.ThirdPartyExamDate.HasValue ? obj.ThirdPartyExamDate.ToString() : "";
                    //txtConstTradeRemovalStartDate.Text = obj.SixMonthsMinExperience_Start.HasValue ? obj.SixMonthsMinExperience_Start.ToString() : "";
                    //txtConstTradeRemovalEndDate.Text = obj.SixMonthsMinExperience_End.HasValue ? obj.SixMonthsMinExperience_End.ToString() : "";
                    //txtRemovalSuperWorkedFor.Text = obj.EmployerNames;
                    txtConstTradeRepaintStartDate.Text = obj.TwoYearMinExperience_Start.HasValue ? Convert.ToDateTime(obj.TwoYearMinExperience_Start.ToString()).ToShortDateString() : "";
                    txtConstTradeRepaintEndDate.Text   = obj.TwoYearMinExperience_End.HasValue ? Convert.ToDateTime(obj.TwoYearMinExperience_End.ToString()).ToShortDateString() : "";
                    txtRepaintSuperWorkedFor.Text      = obj.EmployerNames;
                    chkWaiver.Checked            = obj.Waiver == 1;
                    txtTrainingCardNum.Text      = obj.CourseTrainingCardNum;
                    txtTrainCExpire.Text         = obj.CourseExpirationDate;
                    txtTrainingProviderName.Text = obj.CourseTPName;
                    txtCourseName.Text           = obj.CourseCatName;
                    txtCourseStartDate.Text      = obj.CourseStartDate.HasValue ? Convert.ToDateTime(obj.CourseStartDate.ToString()).ToShortDateString() : "";
                    txtCourseEndDate.Text        = obj.CourseEndDate.HasValue ? Convert.ToDateTime(obj.CourseEndDate.ToString()).ToShortDateString() : "";
                    txtContractorName.Text       = obj.SupervisorContractorName;
                    txtContractorAccdNum.Text    = obj.SupervisorContractorAcctNum;
                    txtIC_Address_Line_1.Text    = obj.SupervisorContractor_Address_Line_1;
                    txtIC_City.Text        = obj.SupervisorContractor_City;
                    txtIC_State.Text       = obj.SupervisorContractor_State;
                    txtIC_Zipcode.Text     = obj.SupervisorContractor_ZipCode;
                    txtICContactFName.Text = obj.SupervisorContactFirstName;
                    txtICContactLName.Text = obj.SupervisorContactLastName;
                    txtICContactPhone.Text = obj.SupervisorContractor_Phone;
                    lblContactInfo.Text    = obj.SupervisorContactFirstName + " " + obj.SupervisorContactLastName + " / " + obj.SupervisorContractor_Phone;

                    chkIAgree.Checked           = obj.Agreed == 1;
                    lblDateSigned.Text          = obj.CreatedDate.ToLongDateString();
                    dropIsRenewal.SelectedValue = obj.IsRenewal.HasValue ? obj.IsRenewal.Value.ToString() : "0";
                    divIsRenewal.Visible        = obj.IsRenewal.Value == 1;
                    dropCategory.SelectedValue  = obj.ACRDCatID.HasValue ? obj.ACRDCatID.ToString() : "0";

                    #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", "") + "</div>"));
                }

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