Beispiel #1
0
        protected void showTable(Panel pnlName, Inspector_RiskAssessor inspector_RiskAssessor)
        {
            var           id         = objcryptoJS.AES_encrypt(inspector_RiskAssessor.Id.ToString(), AppConstants.secretKey, AppConstants.initVec);
            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a style='text-decoration: underline;' href='MDERiskAppView.aspx?RiskApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "' >");
            strContent.Append(inspector_RiskAssessor.InspectorFirstName + " " + inspector_RiskAssessor.InspectorLastName);
            strContent.Append("</a></td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(inspector_RiskAssessor.ACRDCat.CatTitle);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(inspector_RiskAssessor.InspectorContactFirstName + " " + inspector_RiskAssessor.InspectorContactLastName);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append(inspector_RiskAssessor.InspectorContractor_Phone);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(inspector_RiskAssessor.CreatedDate.ToShortDateString());
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-success' href='MDERiskAppView.aspx?RiskApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "'>View</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #2
0
        protected void showTable(Panel pnlName, string CourseTitle, string Category, string Language, string Duration, string Attendence, string Passing, string TPName, string DateCreated, int CourseId)
        {
            string strSPContractorID = objcryptoJS.AES_encrypt(CourseId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a href='#' >");
            strContent.Append(CourseTitle);
            strContent.Append("</a></td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Category);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(TPName);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Language);
            strContent.Append("</td>");
            //strContent.Append("<td width='10%'nowrap>");
            //strContent.Append(Duration);
            //strContent.Append("</td>");

            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Passing);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(GlobalMethods.ContractorAppStatus(Convert.ToInt32(DateCreated), "badge", ""));
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-primary' href='#'>View Details</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #3
0
        protected void showTable(Panel pnlName, string ClassTitle, string StartDateEndDate, string InstructionLanguage, string TP_Name, string Loc_Ti, string InstName, int CourseId)
        {
            string strSPContractorID = objcryptoJS.AES_encrypt(CourseId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a href='ClassDetails.aspx?dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "' >");
            strContent.Append(ClassTitle);
            strContent.Append("</a></td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(StartDateEndDate);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(InstructionLanguage);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(TP_Name);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append("");
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(InstName);
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-successfull' href='ClassDetails.aspx?dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "'>View Details</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #4
0
        protected void showTable(Panel pnlName, TrainingCourse instructor)
        {
            var           id         = objcryptoJS.AES_encrypt(instructor.Id.ToString(), AppConstants.secretKey, AppConstants.initVec);
            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a style='text-decoration: underline;' href='MDE_TCourseAppView.aspx?TCourseApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "' >");
            strContent.Append(instructor.TrainingProviderName);
            strContent.Append("</a></td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(instructor.TPContactFirstName + " " + instructor.TPContactLastName);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(instructor.TP_Telephone);
            strContent.Append("</td>");
            if (pnlName.ID.ToString() == "pnlMyContApps")
            {
                strContent.Append("<td width='10%'nowrap>");
                strContent.Append(GlobalMethods.AppStatus(instructor.IsActive.HasValue ? instructor.IsActive.Value : -1));
                strContent.Append("</td>");
            }
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(instructor.CreatedDate.ToShortDateString());
            strContent.Append("</td>");

            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-success' href='MDE_TCourseAppView.aspx?TCourseApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "'>View</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #5
0
    public string CheckRequest(string strRequest, string DoWhat)
    {
        string   strValue     = "";
        string   strRequestIn = "";
        CryptoJS objcryptoJS  = new CryptoJS();

        strRequestIn = strRequestIn + strRequest;

        if (strRequestIn.Length > 0)
        {
            if (DoWhat == "Encrypt")
            {
                strValue = objcryptoJS.AES_encrypt(strRequestIn.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();
            }
            else if (DoWhat == "Decrypt")
            {
                strValue = objcryptoJS.AES_decrypt(strRequestIn.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();
            }
        }
        else
        {
            strValue = "0";
        }
        return(strValue);
    }
Beispiel #6
0
        protected void showTable(Panel pnlName, string CompName, string Category, string ACRDID, string ACRDDateExpire, string DateCreated, int SPContractorID)
        {
            string strSPContractorID = objcryptoJS.AES_encrypt(SPContractorID.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a href='MDEFinalCA.aspx?certapps=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "' >");
            strContent.Append(CompName);
            strContent.Append("</a></td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(Category);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(ACRDID);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append(ACRDDateExpire);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Convert.ToDateTime(DateCreated).ToShortDateString());
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-primary' href='MDEFinalCA.aspx?certapps=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "'>View Details</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
        protected void showTable(Panel pnlName, string CourseTitle, string Category, string Language, string Duration, string Attendence, string Passing, string DateCreated, int CourseId)
        {
            string strSPContractorID = objcryptoJS.AES_encrypt(CourseId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a href='MDE_TPAppView.aspx?approvetpapp=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "' >");
            strContent.Append(CourseTitle);
            strContent.Append("</a></td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Category);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Language);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");

            strContent.Append(Duration);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Attendence);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Passing);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Convert.ToDateTime(DateCreated).ToShortDateString());
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-primary open-Register' href='#' data-id='" + strSPContractorID + "' data-toggle='modal' title='Click Here To Register'>Click Here to Register</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #8
0
        protected void showTable(Panel pnlName, TrainingCourse training)
        {
            var           id         = objcryptoJS.AES_encrypt(training.Id.ToString(), AppConstants.secretKey, AppConstants.initVec);
            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a style='text-decoration: underline;' href='MDE_TrainAppView.aspx?TrainApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "' >");
            //strContent.Append(training.TPContactFirstName + " " + training.TPContactLastName);
            strContent.Append("</a></td>");
            strContent.Append("<td width='15%' nowrap>");
            //strContent.Append(training.ACRDCat.CatTitle);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            //strContent.Append(training.InspectorContactFirstName + " " + training.InspectorContactLastName);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            //strContent.Append(training.InspectorContractor_Phone);
            strContent.Append("</td>");
            if (pnlName.ID.ToString() == "pnlMyContApps")
            {
                strContent.Append("<td width='10%' nowrap>");
                strContent.Append(GlobalMethods.AppStatus(Convert.ToInt32(training.IsActive)));
                strContent.Append("</td>");
            }
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(training.CreatedDate.ToShortDateString());
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-success' href='MDE_TrainAppView.aspx?TrainApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "'>View</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #9
0
        protected void showTable(Panel pnlName, string CompName, string Name, string Phone, string Category, string IsActive, string DateCreated, int SPContractorID)
        {
            string strSPContractorID = objcryptoJS.AES_encrypt(SPContractorID.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a title='View full application' style='text-decoration: underline;' href='MDEContAppView.aspx?contapps=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "' >");
            strContent.Append(CompName);
            strContent.Append("</a></td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(Category);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Name);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append(Phone);
            strContent.Append("</td>");
            if (pnlName.ID.ToString() == "pnlMyContApps")
            {
                strContent.Append("<td width='10%' nowrap>");
                strContent.Append(GlobalMethods.AppStatus(Convert.ToInt32(IsActive)));
                strContent.Append("</td>");
            }
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Convert.ToDateTime(DateCreated).ToShortDateString());
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-success' title='View full application' href='MDEContAppView.aspx?contapps=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "'>View</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #10
0
        /// <summary>
        /// This function is creating a table values.
        /// </summary>
        /// <param name="FName"></param>
        /// <param name="LName"></param>
        /// <param name="Email"></param>
        /// <param name="DateCreated"></param>
        /// <param name="RoleStatus">is Status of the ROLE this user is selected for. This can be Active or inactive</param>
        /// <param name="UserRoleId">This is the UserRoleId for Admin to disable the Role for a user.</param>
        /// <param name="AcctStatus">This is User Account Status.</param>
        protected void showTable(string FName, string LName, string Email, string DateCreated, string RoleName, int AcctStatus, int IsAdmin, string AuthorisedUserId)
        {
            AuthorisedUserId = objcryptoJS.AES_encrypt(AuthorisedUserId, AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(FName);
            strContent.Append("</td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(LName);
            strContent.Append("</td>");
            strContent.Append("<td width='20%'nowrap>");
            strContent.Append(Email);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append(DateCreated);
            strContent.Append("</td>");
            strContent.Append("<td width='20%' nowrap>");
            strContent.Append(GlobalMethods.AcctStatus(AcctStatus));
            strContent.Append("</td>");
            strContent.Append("<td width='20%'nowrap>");
            strContent.Append(RoleName);
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='10%' nowrap>");
            if (IsAdmin == 0)
            {
                strContent.Append("<a class='btn btn-xs btn-success open-DeleteVideoOff' href='#' data-id='");
                strContent.Append(System.Web.HttpUtility.UrlEncode(AuthorisedUserId));
                strContent.Append("' data-toggle='modal'> Admin On </a>");
            }
            else
            {
                strContent.Append("<a class='btn btn-xs btn-danger open-DeleteVideoOn' href='#' data-id='");
                strContent.Append(System.Web.HttpUtility.UrlEncode(AuthorisedUserId));
                strContent.Append("' data-toggle='modal'> Admin Off </a>");
            }
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='10%' nowrap>");
            if (AcctStatus.ToString() == "-1")
            {
                strContent.Append("<a class='btn btn-xs btn-success open-ActivateAcctOff' href='#' data-id='");
                strContent.Append(System.Web.HttpUtility.UrlEncode(AuthorisedUserId));
                strContent.Append("' data-toggle='modal'> Activate Account </a>");
            }
            else
            {
                strContent.Append("<a class='btn btn-xs btn-danger open-ActivateAcctOn' href='#' data-id='");
                strContent.Append(System.Web.HttpUtility.UrlEncode(AuthorisedUserId));
                strContent.Append("' data-toggle='modal'> Disable Account </a>");
            }
            strContent.Append("</td>");


            pnlVideos.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #11
0
        protected void showTable(string CatTitle, string ACRDCategory, string ValidFor, string ThirdPartyExam, int PassScore_Required, string PassScore, string MDEMasterId)
        {
            MDEMasterId = objcryptoJS.AES_encrypt(MDEMasterId, AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(CatTitle);
            strContent.Append("</td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(ACRDCategory);
            strContent.Append("</td>");

            strContent.Append("<td width='10%' nowrap>");
            if (Convert.ToInt32(ValidFor) > 0)
            {
                strContent.Append(ValidFor + " Year/s");
            }
            else
            {
                strContent.Append("-");
            }

            strContent.Append("</td>");
            strContent.Append("<td width='5%' nowrap>");
            if (ThirdPartyExam == "1")
            {
                strContent.Append("YES");
            }
            else
            {
                strContent.Append("NO");
            }
            strContent.Append("</td>");
            strContent.Append("<td width='5%'nowrap>");
            if (PassScore_Required.ToString() == "1")
            {
                strContent.Append("YES");
            }
            else
            {
                strContent.Append("NO");
            }
            strContent.Append("</td>");
            strContent.Append("<td width='5%'nowrap>");
            strContent.Append(PassScore);
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-warning open-ActivateAcctOn' href='#' data-id='");
            strContent.Append(System.Web.HttpUtility.UrlEncode(MDEMasterId));
            strContent.Append("' data-toggle='modal'> Edit </a>");
            strContent.Append("</td>");

            pnlVideos.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #12
0
        public static string Enroll(string cgi)
        {
            CryptoJS objcryptoJS  = new CryptoJS();
            string   strURL       = string.Empty;
            string   CourseSchdId = string.Empty;
            string   CourseId     = string.Empty;

            try
            {
                CourseSchdId = cgi.ToString() == null ? string.Empty : cgi.ToString();
                if (GlobalMethods.ValueIsNull(CourseSchdId).Length > 0)
                {
                    CourseSchdId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(cgi), AppConstants.secretKey, AppConstants.initVec).ToString();
                }
                int intInstId = 0;

                #region Getting Instructor Id.
                clsCourseSchedule objCourseSch = new clsCourseSchedule();
                objCourseSch = CourseScheduleDAL.SelectCourseScheduleById(Convert.ToInt32(CourseSchdId));
                if (objCourseSch != null)
                {
                    intInstId = objCourseSch.InstructorId.HasValue ? objCourseSch.InstructorId.Value : 0;
                    CourseId  = objCourseSch.TrainingCourseScheduleId.ToString();
                }
                #endregion

                CourseId = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(CourseId), AppConstants.secretKey, AppConstants.initVec).ToString();

                #region Adding to LK_Inst_CourseSchedule
                clsLK_Inst_CourseSchedule objInstCS = new clsLK_Inst_CourseSchedule();
                objInstCS.AuthorisedUserId         = Convert.ToInt32(HttpContext.Current.Session["UserAuthId"]);
                objInstCS.TrainingCourseScheduleId = Convert.ToInt32(CourseSchdId);
                objInstCS.InstructorId             = intInstId;
                objInstCS.TP_AuthorisedUserId      = 0;
                objInstCS.IsApproved  = 0;
                objInstCS.CreatedDate = DateTime.Now;
                objInstCS.ApprovedOn  = Convert.ToDateTime("1/1/1900");
                if (!LK_Inst_CourseScheduleDAL.InsertLK_Inst_CourseSchedule(objInstCS))
                {
                }
                #endregion
            }
            catch (Exception)
            {
                ErrorHandler.ErrorPage();
            }
            return("CourseDetails.aspx?dash=active&cgi=" + CourseId + "");
        }
Beispiel #13
0
        /// <summary>
        /// This function is creating a table values.
        /// </summary>
        /// <param name="FName"></param>
        /// <param name="LName"></param>
        /// <param name="Email"></param>
        /// <param name="DateCreated"></param>
        /// <param name="RoleStatus">is Status of the ROLE this user is selected for. This can be Active or inactive</param>
        /// <param name="UserRoleId">This is the UserRoleId for Admin to disable the Role for a user.</param>
        /// <param name="AcctStatus">This is User Account Status.</param>
        protected void showTable(string FName, string LName, string Email, string DateCreated, string RoleStatus, string UserRoleId, int AcctStatus)
        {
            UserRoleId = objcryptoJS.AES_encrypt(UserRoleId, AppConstants.secretKey, AppConstants.initVec).ToString();

            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(FName);
            strContent.Append("</td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(LName);
            strContent.Append("</td>");
            strContent.Append("<td width='20%'nowrap>");
            strContent.Append(Email);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append(DateCreated);
            strContent.Append("</td>");
            strContent.Append("<td width='20%' nowrap>");
            strContent.Append(GlobalMethods.AcctStatus(AcctStatus));
            strContent.Append("</td>");
            strContent.Append("<td width='20%'nowrap>");
            strContent.Append(GlobalMethods.IsActive(RoleStatus.ToString()));
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='10%' nowrap>");
            if (RoleStatus == "0")
            {
                strContent.Append("<a class='btn btn-xs btn-success open-DeleteVideo' href='#' data-id='");
                strContent.Append(System.Web.HttpUtility.UrlEncode(UserRoleId));
                strContent.Append("' data-toggle='modal'> Activate Role </a>");
            }
            else
            {
                strContent.Append("<a class='btn btn-xs btn-danger open-DeleteVideo' href='#' data-id='");
                strContent.Append(System.Web.HttpUtility.UrlEncode(UserRoleId));
                strContent.Append("' data-toggle='modal'> Deactivate Role </a>");
            }
            strContent.Append("</td>");


            pnlVideos.Controls.Add(new LiteralControl(strContent.ToString()));
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         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(objcryptoJS.AES_encrypt(lstCategory[i].ACRDCatID.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString()))));
                 }
             }
         }
     }
 }
Beispiel #15
0
        public static string Enroll(string cgi)
        {
            CryptoJS objcryptoJS  = new CryptoJS();
            string   strURL       = string.Empty;
            string   CourseSchdId = string.Empty;
            string   CourseId     = string.Empty;

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

                #region Getting the return TrainingCourseId

                #endregion

                clsLK_Inst_CourseSchedule objISC = new clsLK_Inst_CourseSchedule();
                objISC = LK_Inst_CourseScheduleDAL.SelectLK_Inst_CourseScheduleById(Convert.ToInt32(CourseSchdId));
                if (objISC != null)
                {
                    objISC.TP_AuthorisedUserId = Convert.ToInt32(HttpContext.Current.Session["UserAuthId"].ToString());
                    objISC.IsApproved          = 1;
                    CourseId = objISC.TrainingCourseScheduleId.ToString();
                    if (!LK_Inst_CourseScheduleDAL.UpdateLK_Inst_CourseSchedule(objISC))
                    {
                    }
                }
                CourseId = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(CourseId), AppConstants.secretKey, AppConstants.initVec).ToString();
            }
            catch (Exception)
            {
                ErrorHandler.ErrorPage();
            }


            return("Inst_Candidate.aspx?dash=active&cgi=" + CourseId + "");
        }
Beispiel #16
0
        protected void showTable(Panel pnlName, TrainingProvider trainingProvider)
        {
            var           id         = objcryptoJS.AES_encrypt(trainingProvider.Id.ToString(), AppConstants.secretKey, AppConstants.initVec);
            StringBuilder strContent = new StringBuilder("<tr>");

            strContent.Append("<td width='15%' nowrap><a style='text-decoration: underline;' href='MDE_TPAppView.aspx?tpApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "' >");
            strContent.Append(trainingProvider.TP_Name);
            strContent.Append("</a></td>");
            strContent.Append("<td width='15%' nowrap>");
            strContent.Append(trainingProvider.TPContactFirstName + " " + trainingProvider.TPContactLastName);
            strContent.Append("</td>");
            strContent.Append("<td width='10%' nowrap>");
            strContent.Append(trainingProvider.TP_Telephone);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(trainingProvider.CreatedDate.ToShortDateString());
            strContent.Append("</td>");
            //***************************************
            strContent.Append("<td width='5%' nowrap>");
            strContent.Append("<a class='btn btn-xs btn-success' href='MDE_TPAppView.aspx?tpApps=active&cgi=" + System.Web.HttpUtility.UrlEncode(id) + "'>View</a>");
            strContent.Append("</td>");

            pnlName.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Beispiel #17
0
 public void ProcessRequest(HttpContext context)
 {
     if (!context.User.Identity.IsAuthenticated)
     {
         FormsAuthentication.RedirectToLoginPage();
         return;
     }
     if (context.Request.Url.AbsoluteUri.IndexOf(".pdf") > -1)
     {
         using (var stream = new MemoryStream())
         {
             var url      = objcryptoJS.AES_decrypt(context.Request.Url.AbsoluteUri.Split('/').Last().Replace(".pdf", ""), AppConstants.secretKey, AppConstants.initVec);
             var fileName = url;
             using (FileStream fs = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "uf", url + ".pdf"), FileMode.Create))
             {
                 stream.CopyTo(fs);
             }
             context.Response.BinaryWrite(stream.ToArray());
         }
     }
     else
     {
         var userId   = HttpContext.Current.Session["UserAuthId"];
         var template = objcryptoJS.AES_decrypt(context.Request.Url.AbsoluteUri.Split('/').Last().Replace(".cert", ""), AppConstants.secretKey, AppConstants.initVec);
         var content  = new StringBuilder(File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_data", template + ".htm")));
         if (template == "Acct_Certificate")
         {
             content.Replace("{{Name}}", ConvertTextToBase64Image("				Jack Vu", "Arial", 14, Color.White, Color.Black, 694, 70));
             content.Replace("{{CourseName}}", ConvertTextToBase64Image("		Inspection (IC)", "Arial", 14, Color.White, Color.Black, 598, 77));
             content.Replace("{{ExpDate}}", ConvertTextToBase64Image("12,12,2021", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{TP}}", ConvertTextToBase64Image("Zoom Training Center", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{CourseDate}}", ConvertTextToBase64Image("12,12,2020", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{CertId}}", ConvertTextToBase64Image(RandomNumber(5, 100).ToString(), "Arial", 18, Color.White, Color.Black, 152, 31));
         }
         else if (template == "TrainingCard")
         {
             content.Replace("{{Name}}", ConvertTextToBase64Image("Jack Vu", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{ClassCode}}", ConvertTextToBase64Image("Inspection (IC)", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{DOB}}", ConvertTextToBase64Image("12,12,1984", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{ProviderName}}", ConvertTextToBase64Image("Zoom Training Center", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{ExpDate}}", ConvertTextToBase64Image("12,12,2021", "Arial", 18, Color.White, Color.Black, 262, 32));
             content.Replace("{{Number}}", ConvertTextToBase64Image(RandomNumber(5, 100).ToString(), "Arial", 18, Color.White, Color.Black, 262, 32));
         }
         var fileName = Guid.NewGuid();
         context.Response.Headers.Add("Content-Type", "text/pdf");
         context.Response.Headers.Add("Content-Disposition", "attachment; filename=" + objcryptoJS.AES_encrypt(userId.ToString(), AppConstants.secretKey, AppConstants.initVec) + "_" + template + ".pdf");
         using (var stream = new MemoryStream())
         {
             new PdfConverter().Convert(stream, content.ToString());
             var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Attachments");
             var dir  = new DirectoryInfo(path);
             if (!dir.Exists)
             {
                 dir.Create();
             }
             using (FileStream fs = new FileStream(string.Format("{0}\\{1}.pdf", path, fileName), FileMode.Create))
             {
                 stream.CopyTo(fs);
             }
             context.Response.BinaryWrite(stream.ToArray());
             stream.Flush();
         }
     }
 }
Beispiel #18
0
        protected void AddTManual_Click(object sender, EventArgs e)
        {
            Security objSecurity   = new Security();
            CryptoJS objcryptoJS   = new CryptoJS();
            string   ClassResultId = string.Empty;

            #region "variables"
            //// string vSPName = objSecurity.KillChars(txtTPName.Text);
            // string vContractor = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(dropContractors.SelectedItem.Value), AppConstants.secretKey, AppConstants.initVec).ToString();
            // //string vTPPhone = objSecurity.KillChars(txtTPPhone.Text);
            // //string vTPMobile = objSecurity.KillChars(txtTPMobile.Text);
            // //string vTPWebsite = objSecurity.KillChars(txtTPWebsite.Text);
            // //string vTPEmail = objSecurity.KillChars(txtTPEmail.Text);
            // int intNewTPID = 0;
            // int intNewInstructorId = 0;
            #endregion

            #region Instructor Info
            //string vCategory = objcryptoJS.AES_decrypt(dropCategory.SelectedItem.Value, AppConstants.secretKey, AppConstants.initVec).ToString();
            //string vInstructorFName = objSecurity.KillChars(txtInstructorFName.Text);
            //string vInstructorLName = objSecurity.KillChars(txtInstructorLName.Text);
            //string vInsAccId = objSecurity.KillChars(txtInsAccId.Text);
            //string vInsAccExpire = objSecurity.KillChars(txtAccdExpireDate.Text);
            //string vInstEmail = objSecurity.KillChars(txtInstEmail.Text);
            #endregion

            #region Address 1
            //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);
            //string vEmail = objSecurity.KillChars(txtTPEmail.Text);
            //string vLocationTitle = objSecurity.KillChars(txtLocTitle.Text);
            #endregion

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

                clsCourse_Result objCR = new clsCourse_Result();
                objCR = Course_ResultDAL.SelectCourse_ResultById(Convert.ToInt32(ClassResultId));
                if (objCR != null)
                {
                    objCR.PaymentAmount = "120.00";
                    objCR.Acct_Term     = Convert.ToInt32(dropYears.SelectedItem.Value);
                    objCR.Notes         = "User Entered Contractor Id: " + dropContractors.SelectedItem.Value;
                    if (!Course_ResultDAL.UpdateCourse_Result(objCR))
                    {
                    }
                }
            }
            catch (Exception)
            {
                ErrorHandler.ErrorPage();
            }
            string strResultId = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode("10"), AppConstants.secretKey, AppConstants.initVec).ToString();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Your Application has been submitted successfully!', '', 'success', 'RoleDesc.aspx?Dash=active&cgi=" + strResultId + "');", true);
        }
Beispiel #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    string ClassResultId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                    if (GlobalMethods.ValueIsNull(ClassResultId).Length > 0)
                    {
                        ClassResultId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"]), AppConstants.secretKey, AppConstants.initVec).ToString();
                    }

                    #region Getting all the Contractors list
                    List <clsSP_Contractor> lstSPCont = new List <clsSP_Contractor>();
                    lstSPCont = SP_ContractorDAL.SelectDynamicSP_Contractor("IsActive = 1 and ACRDCatID = 13", "SPContractorID");
                    if (lstSPCont != null)
                    {
                        if (lstSPCont.Count > 0)
                        {
                            dropContractors.Items.Add(new ListItem(
                                                          String.Format("{0}", "Select Contractor"), String.Format("{0}", "0")));
                            for (int i = 0; i < lstSPCont.Count; i++)
                            {
                                dropContractors.Items.Add(new ListItem(
                                                              String.Format("{0}", SQLHelper.TrimAndReplaceEOF(lstSPCont[i].SPName.ToString())), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(objcryptoJS.AES_encrypt(lstSPCont[i].SPContractorID.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString()))));
                            }
                        }
                    }
                    #endregion

                    clsCourse_Result objCR = new clsCourse_Result();
                    objCR = Course_ResultDAL.SelectCourse_ResultById(Convert.ToInt32(ClassResultId));
                    if (objCR != null)
                    {
                        if ((objCR.Acct_Term > 0))
                        {
                            btnAddCourse.Enabled = false;
                            btnAddCourse.Text    = "Applied for C&A Certification";
                        }
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Beispiel #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strtpId = string.Empty;
                phWriteComment.Visible = false;

                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 Getting all the Comments by Application Id.
                StringBuilder        strMessenger = new StringBuilder("");
                List <clsTP_Comment> lstComments  = new List <clsTP_Comment>();
                lstComments = TP_CommentDAL.SelectDynamicTP_Comment("TPId = " + strtpId + "", "TPCommentId");
                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 = _tpRepository.PendingApps();

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

                #endregion

                var obj = _tpRepository.Get(int.Parse(strtpId));
                if (obj != null)
                {
                    txtName.Text         = obj.TP_Name;
                    txtSDATNum.Text      = obj.TP_SDAT;
                    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;
                    txtEIN.Text          = obj.TP_TaxID.FromByteArray();
                    txtACCID.Text        = obj.AccreditationID;
                    txtAccreditationExpirationDate.Text = obj.AccreditationExpirationDate.HasValue ? obj.AccreditationExpirationDate.Value.ToShortDateString() : "";
                    chkChargeFee.Checked = obj.TP_Fee == 1;
                    if (!string.IsNullOrWhiteSpace(obj.TP_TaxExempt))
                    {
                        chkTaxExempt.Checked = true;
                    }
                    else
                    {
                        chkTaxExempt.Checked = false;
                    }

                    txtTaxExempt.Text = obj.TP_TaxExempt;
                    if (obj.TPWebsiteURL.Length > 0)
                    {
                        chkTPwebsiteYES.Checked = true;
                        chkTPwebsiteNO.Checked  = false;
                    }
                    else
                    {
                        chkTPwebsiteYES.Checked = false;
                        chkTPwebsiteNO.Checked  = true;
                    }

                    txtTPwebsiteURL.Text         = obj.TPWebsiteURL;
                    chkCORiskAssessor.Checked    = obj.RiskAssessor == 1;
                    chkCOProjectDesigner.Checked = obj.ProjectDesign == 1;
                    chkCOInspectorTech.Checked   = obj.InspectorTech == 1;
                    chkCOAbatWorkEnglish.Checked = obj.AbatWorkerEnglish == 1;
                    chkCOVisualInspector.Checked = obj.VisualInspector == 1;
                    chkCOAbatWorkSpanish.Checked = obj.AbatWorkerSpanish == 1;
                    chkCOMainRepaintSup.Checked  = obj.MainRepaint == 1;
                    chkCOStructSteelSup.Checked  = obj.StructSteelSupervisor == 1;
                    chkCORemovalSup.Checked      = obj.RemovalDemo == 1;
                    chkStructSteelWork.Checked   = obj.StructSteelWorker == 1;
                    txtAuthRepContFName.Text     = obj.TPContactFirstName;
                    txtAuthRepContLName.Text     = obj.TPContactLastName;
                    txtAuthRepContTitle.Text     = obj.TPContactTitle;
                    lblContractorApp.Text        = obj.TP_Name;
                    lblSignedBy.Text             = obj.TPContactFirstName + " " + obj.TPContactLastName;
                    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;
                    }
                    // dropPublicList.Text = obj;
                    lblDateSigned.Text = obj.CreatedDate.ToLongDateString();
                    for (int i = 0; i < obj.Locations.Count; i++)
                    {
                        var element = obj.Locations.ElementAt(i);
                        if (element != null)
                        {
                            var cIndex   = i + 1;
                            var address1 = (TextBox)Page.FindControl("ctl00$CPMain$txtLocation_Address_" + cIndex);
                            var city     = (TextBox)Page.FindControl("ctl00$CPMain$txtLocation_City_" + cIndex);
                            var state    = (TextBox)Page.FindControl("ctl00$CPMain$txtLocation_State_" + cIndex);
                            var zipcode  = (TextBox)Page.FindControl("ctl00$CPMain$txtLocation_ZipCode_" + cIndex);
                            if (address1 != null)
                            {
                                address1.Text = element.TP_Address_Line_1;
                                city.Text     = element.TP_City;
                                state.Text    = element.TP_State;
                                zipcode.Text  = element.TP_ZipCode;
                            }
                        }
                    }
                    for (int i = 0; i < obj.Instructors.Count; i++)
                    {
                        var element = obj.Instructors.ElementAt(i);
                        if (element != null)
                        {
                            var cIndex = i + 1;
                            var fn     = (TextBox)Page.FindControl("ctl00$CPMain$txtInstructorFN_" + cIndex);
                            var ln     = (TextBox)Page.FindControl("ctl00$CPMain$txtInstructorLN_" + cIndex);

                            if (fn != null)
                            {
                                fn.Text = element.TP_InstructorFN;
                                ln.Text = element.TP_InstructorLN;
                            }
                        }
                    }

                    #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(dropPublicList);
                GlobalMethods.DisableControl_DropDownByID(dropIsRenewal);
                #endregion
            }
        }
Beispiel #21
0
        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>&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-danger2 open-Hold' href='#' title='Put Application On Hold' data-id='" + strEnContractId + "' data-toggle='modal' >On Hold</a>&nbsp;<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
            }
        }
Beispiel #22
0
        protected string GettingRoleURL(string RoleId, int AuthUserId, string RoleDesc, StringBuilder strAccess)
        {
            strAccess.Clear();
            strAccess.Append("<a href='RoleDesc.aspx?Dash=active&cgi=" + objcryptoJS.AES_encrypt(RoleId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString() + "' class='btn btn-xs btn-info' Title='Click to learn more on " + RoleDesc + "'>Learn More</a>");

            List <clsUserRole> lstURole = new List <clsUserRole>();

            lstURole = UserRoleDAL.SelectDynamicUserRole("RoleId = " + RoleId + " and AuthorizedUserId = " + AuthUserId + "", "UserRoleId");
            if (lstURole != null)
            {
                if (lstURole.Count > 0)
                {
                    // This is MDE Role
                    if (lstURole[0].RoleId == 1)
                    {
                        #region This is MDE Role access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='dashboardMDE.aspx?Dash=active' class='btn btn-xs btn-success' alt='Click here to access MDE Module'>Access MDE Module</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 2)
                    {
                        #region This is Training Provider access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='RoleDesc.aspx?Dash=active&cgi=" + objcryptoJS.AES_encrypt(lstURole[0].RoleId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString() + "' class='btn btn-xs btn-success' alt='Click here to view Approved Training Provider Applications'>View Training Providers</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 3)
                    {
                        #region This is Instructor access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='RoleDesc.aspx?Dash=active&cgi=" + objcryptoJS.AES_encrypt(lstURole[0].RoleId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString() + "' class='btn btn-xs btn-success' alt='Click here to view Approved Instructors.'>View Instructors</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 4)
                    {
                        #region This is Property Owner access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='dashboardMDE.aspx?Dash=active' class='btn btn-xs btn-success' alt='Click here to Property Owner'>Property Owner Program</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 5)
                    {
                        #region This is Inspector access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='dashboardMDE.aspx?Dash=active' class='btn btn-xs btn-success' alt='Click here to Inspector'>Inspector Program</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 6)
                    {
                        #region This is Trainee access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='dashboardMDE.aspx?Dash=active' class='btn btn-xs btn-success' alt='Click here to Trainee'>Trainee Program</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 7)
                    {
                        #region This is Contractor access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='RoleDesc.aspx?Dash=active&cgi=" + objcryptoJS.AES_encrypt(lstURole[0].RoleId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString() + "' class='btn btn-xs btn-success' alt='Click here to view Approved Contractor Applications'>View Contractor</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 8)
                    {
                        #region This is OVERSIGHT PROGRAM access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='dashboardMDE.aspx?Dash=active' class='btn btn-xs btn-success' alt='Click here to access OVERSIGHT PROGRAM'>OVERSIGHT PROGRAM Program</a>");
                        #endregion
                    }
                    if (lstURole[0].RoleId == 9)
                    {
                        #region This is CERTIFICATION PROGRAM access allowed.
                        strAccess.Clear();
                        strAccess.Append("<a href='dashboardMDE.aspx?Dash=active' class='btn btn-xs btn-success' alt='Click here to access CERTIFICATION PROGRAM'>CERTIFICATION PROGRAM Program</a>");
                        #endregion
                    }
                }
            }
            return(strAccess.ToString());
        }
Beispiel #23
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
            }
        }
Beispiel #24
0
        protected void AddTManual_Click(object sender, EventArgs e)
        {
            Security objSecurity                  = new Security();
            var      vtxtTPName                   = txtTPName.Text;
            var      vtxtAddress_1                = txtAddress_1.Text;
            var      vtxtCity_1                   = txtCity_1.Text;
            var      vtxtState_1                  = txtState_1.Text;
            var      vtxtZipCode_1                = txtZipCode_1.Text;
            var      vtxtAddress_2                = txtAddress_2.Text;
            var      vtxtCity_2                   = txtCity_2.Text;
            var      vtxtState_2                  = txtState_2.Text;
            var      vtxtZipcode_2                = txtZipcode_2.Text;
            var      vtxtPhone                    = txtPhone.Text;
            var      vtxtFax                      = txtFax.Text;
            var      vtxtEmailAddress             = txtEmailAddress.Text;
            var      vtxtSSN                      = txtSSN.Text;
            var      vtxtACCID                    = txtACCID.Text;
            DateTime vAccreditationExpirationDate = default(DateTime);

            if (!string.IsNullOrWhiteSpace(txtAccreditationExpirationDate.Text))
            {
                DateTime.TryParse(txtAccreditationExpirationDate.Text, out vAccreditationExpirationDate);
            }
            var vtxtAccreditationExpirationDate = vAccreditationExpirationDate;
            var vchkRiskAssessor      = chkRiskAssessor.Checked ? 1 : 0;
            var vchkInspectorTech     = chkInspectorTech.Checked ? 1 : 0;
            var vchkVisualInspector   = chkVisualInspector.Checked ? 1 : 0;
            var vchkMainRepaint       = chkMainRepaint.Checked ? 1 : 0;
            var vchkRemoval           = chkRemoval.Checked ? 1 : 0;
            var vchkProjectDesign     = chkProjectDesign.Checked ? 1 : 0;
            var vchkAbatmentEnglish   = chkAbatmentEnglish.Checked ? 1 : 0;
            var vchkAbatmentSpanish   = chkAbatmentSpanish.Checked ? 1 : 0;
            var vchkStructSteelSuper  = chkStructSteelSuper.Checked ? 1 : 0;
            var vchkStructSteelWorker = chkStructSteelWorker.Checked ? 1 : 0;
            var vupload_1             = string.Empty;
            var vupload_2             = string.Empty;
            var vupload_3             = string.Empty;
            var vupload_4             = string.Empty;
            var vupload_5             = string.Empty;

            try
            {
                vupload_1 = Path.Combine("uf", upload_1.FileName);
                upload_1.PostedFile.SaveAs(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, vupload_1));
                vupload_2 = Path.Combine("uf", upload_2.FileName);
                upload_2.PostedFile.SaveAs(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, vupload_2));
                vupload_3 = Path.Combine("uf", upload_3.FileName);
                upload_3.PostedFile.SaveAs(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, vupload_3));
                vupload_4 = Path.Combine("uf", upload_4.FileName);
                upload_4.PostedFile.SaveAs(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, vupload_4));
                vupload_5 = Path.Combine("uf", upload_5.FileName);
                upload_5.PostedFile.SaveAs(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, vupload_5));
            }
            catch { }

            var vtxtAuthRepContFName = txtAuthRepContFName.Text;
            var vtxtAuthRepContLName = txtAuthRepContLName.Text;
            var vtxtAuthRepContTitle = txtAuthRepContTitle.Text;
            var vchkIAgree           = chkIAgree.Checked ? 1 : 0;
            var vdropIsRenewal       = dropIsRenewal.SelectedItem.Value;

            var tc = TrainingCourse.Create(vtxtTPName, vtxtAddress_1, vtxtCity_1, vtxtState_1, vtxtZipCode_1, vtxtAddress_2, vtxtCity_2, vtxtState_2, vtxtZipcode_2, vtxtPhone,
                                           vtxtFax, vtxtEmailAddress, vtxtSSN, vdropIsRenewal, vtxtACCID, vtxtAccreditationExpirationDate, vchkRiskAssessor, vchkInspectorTech, vchkVisualInspector,
                                           vchkMainRepaint, vchkRemoval, vchkProjectDesign, vchkAbatmentEnglish, vchkAbatmentSpanish, vchkStructSteelSuper, vchkStructSteelWorker, vupload_1,
                                           vupload_2, vupload_3, vupload_4, vupload_5, vtxtAuthRepContFName, vtxtAuthRepContLName, vtxtAuthRepContTitle, vchkIAgree);

            _iTCRepository.Add(tc);

            _uow.Commit();

            string strBackToForms = objcryptoJS.AES_encrypt("10", AppConstants.secretKey, AppConstants.initVec).ToString();

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Your Application has been submitted successfully!', '', 'success', 'RoleDesc.aspx?Dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strBackToForms) + "');", true);
        }
Beispiel #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strTPID     = string.Empty;
                string strTPStatus = string.Empty;
                string strTPIDs    = string.Empty;
                try
                {
                    #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)
                        {
                            for (int i = 0; i < lstTPs.Count; i++)
                            {
                                strTPIDs = strTPIDs + lstTPs[i].TPId.ToString() + ",";
                                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
                    strTPIDs = strTPIDs.Substring(0, strTPIDs.Length - 1);
                    #region Getting all the Contractors list
                    List <clsCategory> lstSPCont = new List <clsCategory>();
                    lstSPCont = CategoryDAL.SelectDynamicCategory("(IsActive = 1) AND (ACRDCategory NOT IN ('Contractor Accreditations', 'Instructor accreditations'))", "ACRDCatID");
                    if (lstSPCont != null)
                    {
                        if (lstSPCont.Count > 0)
                        {
                            dropCourseCat.Items.Add(new ListItem(
                                                        String.Format("{0}", "Select Category"), String.Format("{0}", objcryptoJS.AES_encrypt("0", AppConstants.secretKey, AppConstants.initVec).ToString())));

                            for (int i = 0; i < lstSPCont.Count; i++)
                            {
                                dropCourseCat.Items.Add(new ListItem(
                                                            String.Format("{0}", SQLHelper.TrimAndReplaceEOF(lstSPCont[i].CatTitle.ToString())), String.Format("{0}", SQLHelper.TrimAndReplaceEOF(objcryptoJS.AES_encrypt(lstSPCont[i].ACRDCatID.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString()))));
                            }
                        }
                    }
                    #endregion

                    #region Showing all the Courses added to the list.
                    List <dynamic> lstValues;
                    string         strSQL = @"SELECT tbl_Course.TrainingCourseId, tbl_Course.TPId, tbl_Course.CourseTitle, tbl_Course.ACRDCatID, tbl_Course.InstructionLanguage, tbl_Course.CourseDuration, tbl_Course.MeasurementUnit, tbl_Course.InitialOrRenewal, 
                                     tbl_Course.AttendanceRequirement, tbl_Course.PassScore, tbl_Course.CreateDate, tbl_Course.IsActive, tbl_Category.CatTitle
                                     FROM tbl_Course INNER JOIN
                                     tbl_Category ON tbl_Course.ACRDCatID = tbl_Category.ACRDCatID
                                     WHERE        (tbl_Course.TPId IN(" + Convert.ToInt32(strTPIDs) + "))";
                    var            objPar = new DynamicParameters();
                    //objPar.Add("@TPID", strTPID, DbType.Int32);
                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstValues = db.Query <dynamic>(strSQL, objPar, commandType: CommandType.Text).ToList();
                            if (lstValues != null)
                            {
                                if (lstValues.Count > 0)
                                {
                                    for (int i = 0; i < lstValues.Count; i++)
                                    {
                                        showTable(pnlVideos, GlobalMethods.ValueIsNull(lstValues[i].CourseTitle), GlobalMethods.ValueIsNull(lstValues[i].CatTitle), GlobalMethods.ValueIsNull(lstValues[i].InstructionLanguage), GlobalMethods.ValueIsNull(lstValues[i].CourseDuration), GlobalMethods.ValueIsNull(lstValues[i].AttendanceRequirement), GlobalMethods.ValueIsNull(lstValues[i].PassScore) + "%", GlobalMethods.ValueIsNull(lstValues[i].CreateDate), Convert.ToInt32(GlobalMethods.ValueIsNull(lstValues[i].TrainingCourseId)));
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    string IsRole = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode("2"), AppConstants.secretKey, AppConstants.initVec).ToString();
                    pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(9, "bar", "RoleDesc.aspx?Dash=active&cgi=" + IsRole + "") + "</div>"));
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }
        protected void AddTManual_Click(object sender, EventArgs e)
        {
            var vtxtLName        = txtLName.Text;
            var vtxtSuffix       = txtSuffix.Text;
            var vtxtFName        = txtFName.Text;
            var vtxtMName        = txtMName.Text;
            var vtxtAddress_1    = txtAddress_1.Text;
            var vtxtCity_1       = txtCity_1.Text;
            var vtxtState_1      = txtState_1.Text;
            var vtxtZipCode_1    = txtZipCode_1.Text;
            var vtxtAddress_2    = txtAddress_2.Text;
            var vtxtCity_2       = txtCity_2.Text;
            var vtxtState_2      = txtState_2.Text;
            var vtxtZipcode_2    = txtZipcode_2.Text;
            var vtxtPhone        = txtPhone.Text;
            var vtxtEmailAddress = txtEmailAddress.Text;
            var vtxtDOB          = txtDOB.Text;
            var vtxtSSNO         = txtSSNO.Text;
            var vtxtACCID        = txtACCID.Text;
            var vtxtAccreditationExpirationDate = !string.IsNullOrWhiteSpace(txtAccreditationExpirationDate.Text) ? DateTime.Parse(txtAccreditationExpirationDate.Text) : default(DateTime);
            var vtxtConstTradeSteelStartDate    = !string.IsNullOrWhiteSpace(txtConstTradeSteelStartDate.Text) ? DateTime.Parse(txtConstTradeSteelStartDate.Text) : default(DateTime);
            var vtxtConstTradeSteelEndDate      = !string.IsNullOrWhiteSpace(txtConstTradeSteelEndDate.Text) ? DateTime.Parse(txtConstTradeSteelEndDate.Text) : default(DateTime);
            var vtxtSteelSuperWorkedFor         = txtSteelSuperWorkedFor.Text;
            var vtxtThirdPartyRemovalDate       = !string.IsNullOrWhiteSpace(txtThirdPartyRemovalDate.Text) ? DateTime.Parse(txtThirdPartyRemovalDate.Text) : default(DateTime);
            var vtxtConstTradeRemovalStartDate  = !string.IsNullOrWhiteSpace(txtConstTradeRemovalStartDate.Text) ? DateTime.Parse(txtConstTradeRemovalStartDate.Text) : default(DateTime);
            var vtxtConstTradeRemovalEndDate    = !string.IsNullOrWhiteSpace(txtConstTradeRemovalEndDate.Text) ? DateTime.Parse(txtConstTradeRemovalEndDate.Text) : default(DateTime);
            var vtxtRemovalSuperWorkedFor       = txtRemovalSuperWorkedFor.Text;
            var vtxtConstTradeRepaintStartDate  = !string.IsNullOrWhiteSpace(txtConstTradeRepaintStartDate.Text) ? DateTime.Parse(txtConstTradeRepaintStartDate.Text) : default(DateTime);
            var vtxtConstTradeRepaintEndDate    = !string.IsNullOrWhiteSpace(txtConstTradeRepaintEndDate.Text) ? DateTime.Parse(txtConstTradeRepaintEndDate.Text) : default(DateTime);
            var vtxtRepaintSuperWorkedFor       = txtRepaintSuperWorkedFor.Text;
            var vchkWaiver               = chkWaiver.Checked;
            var vtxtTrainingCardNum      = txtTrainingCardNum.Text;
            var vtxtTrainCExpire         = txtTrainCExpire.Text;
            var vtxtTrainingProviderName = txtTrainingProviderName.Text;
            var vtxtCourseName           = txtCourseName.Text;
            var vtxtCourseStartDate      = !string.IsNullOrWhiteSpace(txtCourseStartDate.Text) ? DateTime.Parse(txtCourseStartDate.Text) : default(DateTime);
            var vtxtCourseEndDate        = !string.IsNullOrWhiteSpace(txtCourseEndDate.Text) ? DateTime.Parse(txtCourseEndDate.Text) : default(DateTime);
            var vtxtContractorName       = txtContractorName.Text;
            var vtxtContractorAccdNum    = txtContractorAccdNum.Text;
            var vtxtIC_Address_Line_1    = txtIC_Address_Line_1.Text;
            var vtxtIC_City              = txtIC_City.Text;
            var vtxtIC_State             = txtIC_State.Text;
            var vtxtIC_Zipcode           = txtIC_Zipcode.Text;
            var vtxtICContactFName       = txtICContactFName.Text;
            var vtxtICContactLName       = txtICContactLName.Text;
            var vtxtICContactPhone       = txtICContactPhone.Text;
            var vchkIAgree               = chkIAgree.Checked;
            var vdropIsRenewal           = int.Parse(dropIsRenewal.SelectedItem.Value);
            var vdropCategory            = int.Parse(dropCategory.SelectedItem.Value);

            var supervisor = Supervisor.Create(vtxtLName, vtxtSuffix, vtxtFName, vtxtMName, vtxtAddress_1, vtxtCity_1, vtxtState_1, vtxtZipCode_1, vtxtAddress_2, vtxtCity_2,
                                               vtxtState_2, vtxtZipcode_2, vtxtPhone, vtxtEmailAddress, vtxtDOB, vtxtSSNO, vdropIsRenewal, vtxtACCID,
                                               vtxtAccreditationExpirationDate, vdropCategory, vtxtConstTradeSteelStartDate, vtxtConstTradeSteelEndDate,
                                               vtxtSteelSuperWorkedFor, vtxtThirdPartyRemovalDate, vtxtConstTradeRemovalStartDate, vtxtConstTradeRemovalEndDate,
                                               vtxtRemovalSuperWorkedFor, vtxtConstTradeRepaintStartDate, vtxtConstTradeRepaintEndDate, vtxtRepaintSuperWorkedFor,
                                               vchkWaiver, vtxtTrainingCardNum, vtxtTrainCExpire, vtxtTrainingProviderName, vtxtCourseName, vtxtCourseStartDate,
                                               vtxtCourseEndDate, vtxtContractorName, vtxtContractorAccdNum, vtxtIC_Address_Line_1, vtxtIC_City, vtxtIC_State,
                                               vtxtIC_Zipcode, vtxtICContactFName, vtxtICContactLName, vtxtICContactPhone, vchkIAgree);

            _supervisorRepository.Add(supervisor);
            _uow.Commit();
            if (vdropCategory == Category.StructuralSteelSupervisor)
            {
                foreach (var each in _supervisorRepository.Form_Experience_Maps(Category.StructuralSteelSupervisor))
                {
                    var label     = Request.Form["lbl_" + each.Experience.ExperienceTitle];
                    var chkRegion = Request.Form["chk_" + each.Experience.ExperienceTitle.Replace(" ", "")] == "on";
                    if (chkRegion)
                    {
                        var exp = Supervisor_Experiences.Create(supervisor.Id, each.ExperienceId, label == "Other" ? label : string.Empty);
                        _supervisorRepository.AddExperience(exp);
                    }
                }
            }
            else if (vdropCategory == Category.RemovalAndDemolition)
            {
                foreach (var each in _supervisorRepository.Form_Experience_Maps(Category.RemovalAndDemolition))
                {
                    var label     = Request.Form["lbl_" + each.Experience.ExperienceTitle];
                    var chkRegion = Request.Form["chk_" + each.Experience.ExperienceTitle.Replace(" ", "")] == "on";
                    if (chkRegion)
                    {
                        var exp = Supervisor_Experiences.Create(supervisor.Id, each.ExperienceId, label == "Other" ? label : string.Empty);
                        _supervisorRepository.AddExperience(exp);
                    }
                }
            }
            else if (vdropCategory == Category.MaintananceAndRepainting)
            {
                foreach (var each in _supervisorRepository.Form_Experience_Maps(Category.MaintananceAndRepainting))
                {
                    var label     = Request.Form["lbl_" + each.Experience.ExperienceTitle];
                    var chkRegion = Request.Form["chk_" + each.Experience.ExperienceTitle.Replace(" ", "")] == "on";
                    if (chkRegion)
                    {
                        var exp = Supervisor_Experiences.Create(supervisor.Id, each.ExperienceId, label == "Other" ? label : string.Empty);
                        _supervisorRepository.AddExperience(exp);
                    }
                }
            }
            _uow.Commit();

            string strBackToForms = objcryptoJS.AES_encrypt("10", AppConstants.secretKey, AppConstants.initVec).ToString();

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Your Application has been submitted successfully!', '', 'success', 'RoleDesc.aspx?Dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strBackToForms) + "');", true);
        }
Beispiel #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strTPID = string.Empty;
                string strTCid = 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();
                    }

                    #region Showing all the Courses added to the list.
                    List <dynamic> lstValues;
                    string         strSQL = @"SELECT        tbl_TrainingProvider.TPId, tbl_TrainingProvider.TP_Name, tbl_TrainingProvider.TP_Logo_URL, tbl_TrainingProvider.TP_WebSite, tbl_TrainingProvider.TP_Telephone, tbl_TrainingProvider.CreatedDate, 
                         tbl_TrainingProvider.CreatedBy, tbl_TrainingProvider.UpdatedDate, tbl_TrainingProvider.UpdatedBy, tbl_TrainingProvider.Notes, tbl_TrainingProvider.IsActive, tbl_Course_Result.AuthorisedUserId, 
                         tbl_LK_Inst_CourseSchedule.IsApproved, tbl_User.FName, tbl_User.LName, tbl_User.EmailId, tbl_LK_Inst_CourseSchedule.ApprovedOn, tbl_Instructor.Instructor_FName, tbl_Instructor.Instructor_LName, 
                         tbl_CourseSchedule.StartDate, tbl_CourseSchedule.EndDate, tbl_LK_Inst_CourseSchedule.Inst_CourseSchId
FROM            tbl_Course_Result INNER JOIN
                         tbl_TrainingProvider ON tbl_Course_Result.TPId = tbl_TrainingProvider.TPId INNER JOIN
                         tbl_LK_Inst_CourseSchedule ON tbl_Course_Result.AuthorisedUserId = tbl_LK_Inst_CourseSchedule.AuthorisedUserId INNER JOIN
                         tbl_User ON tbl_Course_Result.AuthorisedUserId = tbl_User.AuthorisedUserId INNER JOIN
                         tbl_TP_Location ON tbl_Course_Result.TPLocationId = tbl_TP_Location.TPLocationId INNER JOIN
                         tbl_Instructor ON tbl_Course_Result.InstructorId = tbl_Instructor.InstructorId INNER JOIN
                         tbl_CourseSchedule ON tbl_Course_Result.TrainingCourseScheduleId = tbl_CourseSchedule.TrainingCourseScheduleId
WHERE        (tbl_TrainingProvider.TPId = @TPID) AND (tbl_LK_Inst_CourseSchedule.IsApproved = 1)";
                    var            objPar = new DynamicParameters();
                    objPar.Add("@TPID", Convert.ToInt32(strTPID), DbType.Int32);
                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstValues = db.Query <dynamic>(strSQL, objPar, commandType: CommandType.Text).ToList();
                            if (lstValues != null)
                            {
                                if (lstValues.Count > 0)
                                {
                                    for (int i = 0; i < lstValues.Count; i++)
                                    {
                                        showTable(pnlVideos, GlobalMethods.ValueIsNull(lstValues[i].FName), GlobalMethods.ValueIsNull(lstValues[i].LName), GlobalMethods.ValueIsNull(lstValues[i].EmailId), "", GlobalMethods.ValueIsNull(lstValues[i].Instructor_FName) + " " + GlobalMethods.ValueIsNull(lstValues[i].Instructor_LName), Convert.ToDateTime(GlobalMethods.ValueIsNull(lstValues[i].StartDate)).ToShortDateString() + "-" + Convert.ToDateTime(GlobalMethods.ValueIsNull(lstValues[i].EndDate)).ToShortDateString(), Convert.ToInt32(GlobalMethods.ValueIsNull(lstValues[i].IsApproved)), Convert.ToInt32(GlobalMethods.ValueIsNull(lstValues[i].Inst_CourseSchId)));
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion
                    strTCid = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode("2".ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(9, "bar", "RoleDesc.aspx?Dash=active&cgi=" + strTCid + "") + "</div>"));
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }
Beispiel #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strInspectorRiskAssId = string.Empty;
                phWriteComment.Visible = false;

                strInspectorRiskAssId = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                if (GlobalMethods.ValueIsNull(strInspectorRiskAssId).Length > 0)
                {
                    strInspectorRiskAssId = 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 <clsRiskAssessor_Comment> lstComments = new List <clsRiskAssessor_Comment>();
                lstComments = RiskAssessor_CommentDAL.SelectDynamicRiskAssessor_Comment("InspectorRiskAssId = " + strInspectorRiskAssId + "", "InspectorRiskAssId");
                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 = _riskAssessorRepository.PendingApps();

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

                #endregion

                var obj = _riskAssessorRepository.Get(int.Parse(strInspectorRiskAssId));
                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;
                    lblSignedBy.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        = "View Attachment";
                        lkupload.NavigateUrl = 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;
                    }
                    txtICContactPhone.Text = obj.InspectorContractor_Phone;

                    #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
            }
        }
        protected void AddTManual_Click(object sender, EventArgs e)
        {
            Security objSecurity                  = new Security();
            var      vtxtName                     = txtName.Text;
            var      vtxtSDATNum                  = txtSDATNum.Text;
            var      vtxtAddress_1                = txtAddress_1.Text;
            var      vtxtCity_1                   = txtCity_1.Text;
            var      vtxtState_1                  = txtState_1.Text;
            var      vtxtZipCode_1                = txtZipCode_1.Text;
            var      vtxtAddress_2                = txtAddress_2.Text;
            var      vtxtCity_2                   = txtCity_2.Text;
            var      vtxtState_2                  = txtState_2.Text;
            var      vtxtZipcode_2                = txtZipcode_2.Text;
            var      vtxtPhone                    = txtPhone.Text;
            var      vtxtFax                      = txtFax.Text;
            var      vtxtEmailAddress             = txtEmailAddress.Text;
            var      vtxtEIN                      = txtEIN.Text;
            var      vtxtACCID                    = txtACCID.Text;
            DateTime vAccreditationExpirationDate = default(DateTime);

            if (!string.IsNullOrWhiteSpace(txtAccreditationExpirationDate.Text))
            {
                DateTime.TryParse(txtAccreditationExpirationDate.Text, out vAccreditationExpirationDate);
            }
            var vchkChargeFee          = chkChargeFee.Checked ? 1 : 0;
            var vchkTaxExempt          = chkTaxExempt.Checked ? 1 : 0;
            var vtxtTaxExempt          = txtTaxExempt.Text;
            var vchkTPwebsiteYES       = chkTPwebsiteYES.Checked ? 1 : 0;
            var vtxtTPwebsiteURL       = txtTPwebsiteURL.Text;
            var vchkTPwebsiteNO        = chkTPwebsiteNO.Checked ? 1 : 0;
            var vtxtLocation_Address_1 = txtLocation_Address_1.Text;
            var vtxtLocation_City_1    = txtLocation_City_1.Text;
            var vtxtLocation_State_1   = txtLocation_State_1.Text;
            var vtxtLocation_ZipCode_1 = txtLocation_ZipCode_1.Text;
            var vtxtLocation_Address_2 = txtLocation_Address_2.Text;
            var vtxtLocation_City_2    = txtLocation_City_2.Text;
            var vtxtLocation_State_2   = txtLocation_State_2.Text;
            var vtxtLocation_ZipCode_2 = txtLocation_ZipCode_2.Text;
            var vtxtLocation_Address_3 = txtLocation_Address_3.Text;
            var vtxtLocation_City_3    = txtLocation_City_3.Text;
            var vtxtLocation_State_3   = txtLocation_State_3.Text;
            var vtxtLocation_ZipCode_3 = txtLocation_ZipCode_3.Text;
            var vtxtLocation_Address_4 = txtLocation_Address_4.Text;
            var vtxtLocation_City_4    = txtLocation_City_4.Text;
            var vtxtLocation_State_4   = txtLocation_State_4.Text;
            var vtxtLocation_ZipCode_4 = txtLocation_ZipCode_4.Text;
            var vtxtLocation_Address_5 = txtLocation_Address_5.Text;
            var vtxtLocation_City_5    = txtLocation_City_5.Text;
            var vtxtLocation_State_5   = txtLocation_State_5.Text;
            var vtxtLocation_ZipCode_5 = txtLocation_ZipCode_5.Text;
            var vtxtLocation_Address_6 = txtLocation_Address_6.Text;
            var vtxtLocation_City_6    = txtLocation_City_6.Text;
            var vtxtLocation_State_6   = txtLocation_State_6.Text;
            var vtxtLocation_ZipCode_6 = txtLocation_ZipCode_6.Text;
            var vchkCORiskAssessor     = chkCORiskAssessor.Checked ? 1 : 0;
            var vchkCOProjectDesigner  = chkCOProjectDesigner.Checked ? 1 : 0;
            var vchkCOInspectorTech    = chkCOInspectorTech.Checked ? 1 : 0;
            var vchkCOAbatWorkEnglish  = chkCOAbatWorkEnglish.Checked ? 1 : 0;
            var vchkCOVisualInspector  = chkCOVisualInspector.Checked ? 1 : 0;
            var vchkCOAbatWorkSpanish  = chkCOAbatWorkSpanish.Checked ? 1 : 0;
            var vchkCOMainRepaintSup   = chkCOMainRepaintSup.Checked ? 1 : 0;
            var vchkCOStructSteelSup   = chkCOStructSteelSup.Checked ? 1 : 0;
            var vchkCORemovalSup       = chkCORemovalSup.Checked ? 1 : 0;
            var vchkStructSteelWork    = chkStructSteelWork.Checked ? 1 : 0;
            var vtxtInstructorFN_1     = txtInstructorFN_1.Text;
            var vtxtInstructorLN_1     = txtInstructorLN_1.Text;
            var vtxtInstructorFN_2     = txtInstructorFN_2.Text;
            var vtxtInstructorLN_2     = txtInstructorLN_2.Text;
            var vtxtInstructorFN_3     = txtInstructorFN_3.Text;
            var vtxtInstructorLN_3     = txtInstructorLN_3.Text;
            var vtxtInstructorFN_4     = txtInstructorFN_4.Text;
            var vtxtInstructorLN_4     = txtInstructorLN_4.Text;
            var vtxtInstructorFN_5     = txtInstructorFN_5.Text;
            var vtxtInstructorLN_5     = txtInstructorLN_5.Text;
            var vtxtInstructorFN_6     = txtInstructorFN_6.Text;
            var vtxtInstructorLN_6     = txtInstructorLN_6.Text;
            var vtxtInstructorFN_7     = txtInstructorFN_7.Text;
            var vtxtInstructorLN_7     = txtInstructorLN_7.Text;
            var vtxtInstructorFN_8     = txtInstructorFN_8.Text;
            var vtxtInstructorLN_8     = txtInstructorLN_8.Text;
            var vtxtAuthRepContFName   = txtAuthRepContFName.Text;
            var vtxtAuthRepContLName   = txtAuthRepContLName.Text;
            var vtxtAuthRepContTitle   = txtAuthRepContTitle.Text;
            var vchkIAgree             = chkIAgree.Checked ? 1 : 0;
            var vdropPublicList        = int.Parse(dropPublicList.SelectedItem.Value);
            var vdropIsRenewal         = int.Parse(dropIsRenewal.SelectedItem.Value);

            var tp = TrainingProvider.Create(vtxtName, vtxtSDATNum, vtxtAddress_1, vtxtCity_1, vtxtState_1, vtxtZipCode_1, vtxtAddress_2, vtxtCity_2, vtxtState_2, vtxtZipcode_2,
                                             vdropPublicList, vtxtPhone, vtxtFax, vtxtEmailAddress, vtxtEIN, vdropIsRenewal, vtxtACCID, vAccreditationExpirationDate, vchkChargeFee, vchkTaxExempt,
                                             vtxtTaxExempt, vchkTPwebsiteYES, vtxtTPwebsiteURL, vchkTPwebsiteNO, vchkCORiskAssessor,
                                             vchkCOProjectDesigner, vchkCOInspectorTech, vchkCOAbatWorkEnglish, vchkCOVisualInspector, vchkCOAbatWorkSpanish, vchkCOMainRepaintSup, vchkCOStructSteelSup,
                                             vchkCORemovalSup, vchkStructSteelWork, vtxtAuthRepContFName, vtxtAuthRepContLName, vtxtAuthRepContTitle, vchkIAgree);

            _tPRepository.Add(tp);
            _uow.Commit();
            _tPRepository.AddLocation(TP_Location.Create(tp.Id, vtxtLocation_Address_1, vtxtLocation_City_1, vtxtLocation_State_1, vtxtLocation_ZipCode_1));
            _tPRepository.AddLocation(TP_Location.Create(tp.Id, vtxtLocation_Address_2, vtxtLocation_City_2, vtxtLocation_State_2, vtxtLocation_ZipCode_2));
            _tPRepository.AddLocation(TP_Location.Create(tp.Id, vtxtLocation_Address_3, vtxtLocation_City_3, vtxtLocation_State_3, vtxtLocation_ZipCode_3));
            _tPRepository.AddLocation(TP_Location.Create(tp.Id, vtxtLocation_Address_4, vtxtLocation_City_4, vtxtLocation_State_4, vtxtLocation_ZipCode_4));
            _tPRepository.AddLocation(TP_Location.Create(tp.Id, vtxtLocation_Address_5, vtxtLocation_City_5, vtxtLocation_State_5, vtxtLocation_ZipCode_5));
            _tPRepository.AddLocation(TP_Location.Create(tp.Id, vtxtLocation_Address_6, vtxtLocation_City_6, vtxtLocation_State_6, vtxtLocation_ZipCode_6));

            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_1, vtxtInstructorLN_1));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_2, vtxtInstructorLN_2));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_3, vtxtInstructorLN_3));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_4, vtxtInstructorLN_4));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_5, vtxtInstructorLN_5));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_6, vtxtInstructorLN_6));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_7, vtxtInstructorLN_7));
            _tPRepository.AddInstrutor(TP_Instructors.Create(tp.Id, vtxtInstructorFN_8, vtxtInstructorLN_8));
            _uow.Commit();

            string strBackToForms = objcryptoJS.AES_encrypt("10", AppConstants.secretKey, AppConstants.initVec).ToString();

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Your Application has been submitted successfully!', '', 'success', 'RoleDesc.aspx?Dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strBackToForms) + "');", true);
        }
Beispiel #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strInstID    = string.Empty;
                string strTPID      = string.Empty;
                string strUserEmail = string.Empty;

                try
                {
                    #region Getting User Email
                    clsUser objUser = new clsUser();
                    objUser = UserDAL.SelectUserById(Convert.ToInt32(HttpContext.Current.Session["UserAuthId"].ToString()));
                    if (objUser != null)
                    {
                        strUserEmail = objUser.EmailId;
                    }
                    #endregion

                    #region Showing all the Courses added to the list.
                    List <dynamic> lstValues;
                    //                    string strSQL = @"SELECT DISTINCT
                    //                         tbl_CourseSchedule.TrainingCourseScheduleId, tbl_CourseSchedule.CourseId, tbl_CourseSchedule.InstructorId, tbl_CourseSchedule.ClassTitle, tbl_CourseSchedule.StartDate, tbl_CourseSchedule.EndDate,
                    //                         tbl_CourseSchedule.InstructionLanguage, tbl_CourseSchedule.RegistrationLimit, tbl_CourseSchedule.ExpectedEnrollment, tbl_CourseSchedule.CourseCancelled, tbl_CourseSchedule.CancellationReason,
                    //                         tbl_CourseSchedule.CreateDate, tbl_CourseSchedule.CreatedBy, tbl_CourseSchedule.UpdatedDate, tbl_CourseSchedule.UpdatedBy, tbl_CourseSchedule.Notes, tbl_CourseSchedule.IsActive, tbl_CourseSchedule.TPId,
                    //                         tbl_TrainingProvider.CreatedBy AS UserCreatedTP, tbl_CourseSchedule.CourseCost, tbl_TrainingProvider.TP_Name
                    //FROM            tbl_CourseSchedule INNER JOIN
                    //                         tbl_TP_Location ON tbl_CourseSchedule.TPId = tbl_TP_Location.TPId INNER JOIN
                    //                         tbl_TrainingProvider ON tbl_CourseSchedule.TPId = tbl_TrainingProvider.TPId
                    //WHERE        (tbl_CourseSchedule.InstructorId = @InstructorId)";
                    string strSQL = @"SELECT DISTINCT 
                         tbl_CourseSchedule.TrainingCourseScheduleId, tbl_CourseSchedule.CourseId, tbl_CourseSchedule.InstructorId, tbl_CourseSchedule.ClassTitle, tbl_CourseSchedule.StartDate, tbl_CourseSchedule.EndDate, 
                         tbl_CourseSchedule.InstructionLanguage, tbl_CourseSchedule.RegistrationLimit, tbl_CourseSchedule.ExpectedEnrollment, tbl_CourseSchedule.CourseCancelled, tbl_CourseSchedule.CancellationReason, 
                         tbl_CourseSchedule.CreateDate, tbl_CourseSchedule.CreatedBy, tbl_CourseSchedule.UpdatedDate, tbl_CourseSchedule.UpdatedBy, tbl_CourseSchedule.Notes, tbl_CourseSchedule.IsActive, tbl_CourseSchedule.TPId, 
                         tbl_TrainingProvider.CreatedBy AS UserCreatedTP, tbl_CourseSchedule.CourseCost, tbl_TrainingProvider.TP_Name, tbl_LK_TP_Instructor.Instructor_AuthoriseUserId, tbl_CourseSchedule.TPLocationId, 
                         tbl_TP_Location.TP_Address_Line_1, tbl_TP_Location.TP_City, tbl_TP_Location.TP_State, tbl_TP_Location.TP_ZipCode
                         FROM            tbl_CourseSchedule INNER JOIN
                         tbl_TrainingProvider ON tbl_CourseSchedule.TPId = tbl_TrainingProvider.TPId INNER JOIN
                         tbl_LK_TP_Instructor ON tbl_CourseSchedule.InstructorId = tbl_LK_TP_Instructor.InstructorId AND tbl_CourseSchedule.TPId = tbl_LK_TP_Instructor.TPId INNER JOIN
                         tbl_TP_Location ON tbl_CourseSchedule.TPLocationId = tbl_TP_Location.TPLocationId
                         WHERE        (tbl_LK_TP_Instructor.Instructor_AuthoriseUserId = @InstructorId)";
                    var    objPar = new DynamicParameters();
                    objPar.Add("@InstructorId", Convert.ToInt32(HttpContext.Current.Session["UserAuthId"].ToString()), DbType.Int32);

                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstValues = db.Query <dynamic>(strSQL, objPar, commandType: CommandType.Text).ToList();
                            if (lstValues != null)
                            {
                                if (lstValues.Count > 0)
                                {
                                    for (int i = 0; i < lstValues.Count; i++)
                                    {
                                        showTable(pnlVideos, GlobalMethods.ValueIsNull(lstValues[i].TP_Name), GlobalMethods.ValueIsNull(lstValues[i].ClassTitle), Convert.ToDateTime(GlobalMethods.ValueIsNull(lstValues[i].StartDate)).ToShortDateString() + "-" + Convert.ToDateTime(GlobalMethods.ValueIsNull(lstValues[i].EndDate)).ToShortDateString(), GlobalMethods.ValueIsNull(lstValues[i].InstructionLanguage), GlobalMethods.ValueIsNull(lstValues[i].CourseCost), GlobalMethods.ValueIsNull(lstValues[i].TP_Address_Line_1) + " / " + GlobalMethods.ValueIsNull(lstValues[i].TP_City), Convert.ToInt32(GlobalMethods.ValueIsNull(lstValues[i].TrainingCourseScheduleId)));
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    string strTCid = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode("3"), AppConstants.secretKey, AppConstants.initVec).ToString();
                    pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(9, "bar", "RoleDesc.aspx?Dash=active&cgi=" + strTCid + "") + "</div>"));
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }