Esempio n. 1
0
        protected void showTableCertAccredit(string Title, string Inst_Name, string Cat, string TPName, string ClassResultId)
        {
            string strSPContractorID = objcryptoJS.AES_encrypt(ClassResultId.ToString(), AppConstants.secretKey, AppConstants.initVec).ToString();

            bool IsSubmitted = false;

            clsCourse_Result objCR = new clsCourse_Result();

            objCR = Course_ResultDAL.SelectCourse_ResultById(Convert.ToInt32(ClassResultId));
            if (objCR != null)
            {
                if ((objCR.Acct_Term > 0))
                {
                    IsSubmitted = true;
                }
            }

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

            strContent.Append("<td width='15%' nowrap><a href='AppCA.aspx?dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "' >");
            strContent.Append(Title);
            strContent.Append("</a></td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Inst_Name);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(Cat);
            strContent.Append("</td>");
            strContent.Append("<td width='10%'nowrap>");
            strContent.Append(TPName);
            strContent.Append("</td>");

            //***************************************
            strContent.Append("<td width='5%' nowrap>");

            if (IsSubmitted)
            {
                strContent.Append("<a class='btn btn-xs btn-default' href='#'>Applied for C&A Certification</a>");
            }
            else
            {
                strContent.Append("<a class='btn btn-xs btn-primary' href='AppCA.aspx?dash=active&cgi=" + System.Web.HttpUtility.UrlEncode(strSPContractorID) + "'>Apply for C&A</a>");
            }

            strContent.Append("</td>");

            pnlMyCourses.Controls.Add(new LiteralControl(strContent.ToString()));
        }
Esempio n. 2
0
        protected void AddTManual_Click(object sender, EventArgs e)
        {
            Security objSecurity = new Security();

            #region "variables"
            string vPayment     = dropPayment.SelectedItem.Value;
            string vBackGround  = dropBackGround.SelectedItem.Value;
            string vVerify      = dropEmpVerify.SelectedItem.Value;
            string vComments    = string.Empty;
            string vFinalStatus = dropFinalStatus.SelectedItem.Value;


            #endregion

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

            clsCourse_Result objCR = new clsCourse_Result();
            objCR = Course_ResultDAL.SelectCourse_ResultById(Convert.ToInt32(strTCSID));
            if (objCR != null)
            {
                objCR.MDE_AuthorisedUserId = Convert.ToInt32(HttpContext.Current.Session["UserAuthId"].ToString());
                objCR.MDE_EmployerVeri     = Convert.ToInt32(vVerify);
                objCR.MDE_BackGround       = Convert.ToInt32(vBackGround);
                objCR.MDE_PaymentVeri      = Convert.ToInt32(vPayment);
                objCR.MDE_F_Decision       = Convert.ToInt32(vFinalStatus);
                objCR.MDE_F_Notes          = vComments;
                objCR.Notes    = objCR.Notes + "  " + DateTime.Now.ToShortDateString();
                objCR.IsActive = Convert.ToInt32(vFinalStatus);

                if (Course_ResultDAL.UpdateCourse_Result(objCR))
                {
                    //strTCSID = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(strTCSID.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Saved successfully!', '', 'success', 'MDE_ApprCertApps.aspx?approvecertapp=active');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Error: Cannot Save Records!', '', 'danger', '#');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Error: Cannot Save Records!', '', 'danger', '#');", true);
            }
        }
Esempio n. 3
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)
                {
                }
            }
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        protected void AddTManual_Click(object sender, EventArgs e)
        {
            Security objSecurity = new Security();

            #region "variables"
            string vPassFail                 = dropPassFail.SelectedItem.Value;
            string vtxtAttendence            = dropAttendence.SelectedItem.Value;
            string vScore                    = dropScore.SelectedItem.Value;
            string vAuthorisedUserId         = string.Empty;
            string vTrainingCourseScheduleId = string.Empty;
            string vInstructorId             = string.Empty;
            string vTPLocationId             = string.Empty;
            string vTPId           = string.Empty;
            string vSPContractorID = string.Empty;

            #endregion

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

            #region Getting rest of the values.
            List <dynamic> lstCourses;
            string         strSQLC = @"SELECT        tbl_LK_Inst_CourseSchedule.Inst_CourseSchId, tbl_LK_Inst_CourseSchedule.AuthorisedUserId, tbl_LK_Inst_CourseSchedule.TrainingCourseScheduleId, tbl_LK_Inst_CourseSchedule.InstructorId, 
                               tbl_LK_Inst_CourseSchedule.TP_AuthorisedUserId, tbl_CourseSchedule.CourseId, tbl_LK_Inst_CourseSchedule.IsApproved, tbl_CourseSchedule.TPLocationId, tbl_CourseSchedule.TPId
                              FROM            tbl_LK_Inst_CourseSchedule INNER JOIN
                              tbl_CourseSchedule ON tbl_LK_Inst_CourseSchedule.TrainingCourseScheduleId = tbl_CourseSchedule.TrainingCourseScheduleId INNER JOIN
                              tbl_TrainingProvider ON tbl_CourseSchedule.TPId = tbl_TrainingProvider.TPId
                              WHERE        (tbl_LK_Inst_CourseSchedule.Inst_CourseSchId = @CourseSchId)";
            var            objParC = new DynamicParameters();
            objParC.Add("@CourseSchId", strTCSID, DbType.String);
            try
            {
                using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                {
                    lstCourses = db.Query <dynamic>(strSQLC, objParC, commandType: CommandType.Text).ToList();
                    if (lstCourses != null)
                    {
                        if (lstCourses.Count > 0)
                        {
                            vAuthorisedUserId         = GlobalMethods.ValueIsNull(lstCourses[0].AuthorisedUserId);
                            vTrainingCourseScheduleId = GlobalMethods.ValueIsNull(lstCourses[0].TrainingCourseScheduleId);
                            vInstructorId             = GlobalMethods.ValueIsNull(lstCourses[0].InstructorId);
                            vTPLocationId             = GlobalMethods.ValueIsNull(lstCourses[0].TPLocationId);
                            vTPId           = GlobalMethods.ValueIsNull(lstCourses[0].TPId);
                            vSPContractorID = GlobalMethods.ValueIsNull(lstCourses[0].SPContractorID);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.ErrorLogging(ex, false);
                ErrorHandler.ReadError();
            }
            #endregion

            #region Checking if this is IsApproved ... if not Updating the value with TPID to LK_Inst_CourseSchedule
            List <clsLK_Inst_CourseSchedule> lstICS = new List <clsLK_Inst_CourseSchedule>();
            lstICS = LK_Inst_CourseScheduleDAL.SelectDynamicLK_Inst_CourseSchedule("Inst_CourseSchId = " + strTCSID + " and AuthorisedUserId = " + vAuthorisedUserId + " and IsApproved = 1", "Inst_CourseSchId");
            if (lstICS != null)
            {
                if (lstICS.Count > 0)
                {
                }
                else
                {
                    clsLK_Inst_CourseSchedule objICS = new clsLK_Inst_CourseSchedule();
                    objICS = LK_Inst_CourseScheduleDAL.SelectLK_Inst_CourseScheduleById(Convert.ToInt32(strTCSID));
                    if (objICS != null)
                    {
                        objICS.IsApproved          = 1;
                        objICS.TP_AuthorisedUserId = Convert.ToInt32(vTPId);
                        if (!LK_Inst_CourseScheduleDAL.UpdateLK_Inst_CourseSchedule(objICS))
                        {
                        }
                    }
                }
            }
            #endregion


            clsCourse_Result objCR = new clsCourse_Result();
            objCR.Inst_CourseSchId         = Convert.ToInt32(strTCSID);
            objCR.AuthorisedUserId         = Convert.ToInt32(vAuthorisedUserId);
            objCR.TrainingCourseScheduleId = Convert.ToInt32(vTrainingCourseScheduleId);
            objCR.InstructorId             = Convert.ToInt32(vInstructorId);
            objCR.MDE_AuthorisedUserId     = 0;
            objCR.TPLocationId             = Convert.ToInt32(vTPLocationId);
            objCR.TPId                 = Convert.ToInt32(vTPId);
            objCR.SPContractorID       = 0;
            objCR.Inst_PASSFAIL        = Convert.ToInt32(vPassFail);
            objCR.Inst_Attendence      = Convert.ToInt32(vtxtAttendence);
            objCR.Inst_ScorePercent    = vScore;
            objCR.Inst_TrainingCard    = "";
            objCR.MDE_EmployerVeri     = 0;
            objCR.MDE_BackGround       = 0;
            objCR.MDE_PaymentVeri      = 0;
            objCR.PaymentAmount        = "";
            objCR.Acct_Term            = 0;
            objCR.MDE_F_Decision       = 0;
            objCR.MDE_F_Notes          = "";
            objCR.MDE_Acct_Certificate = "";
            objCR.CreatedDate          = DateTime.Now;
            objCR.Notes                = "";
            objCR.IsActive             = -1;

            if (Course_ResultDAL.InsertCourse_Result(objCR))
            {
                strTCSID = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(strTCSID.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Saved successfully!', '', 'success', 'Inst_SaveScores.aspx?dash=active&cgi=" + strTCSID + "');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "CallNotify('Error: Cannot Save Records!', '', 'danger', '#');", true);
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strTCSID = string.Empty;
                string strTCid  = string.Empty;
                try
                {
                    strTCSID = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                    if (GlobalMethods.ValueIsNull(strTCSID).Length > 0)
                    {
                        strTCSID = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    }

                    #region Getting Class Details
                    clsLK_Inst_CourseSchedule objCS = new clsLK_Inst_CourseSchedule();
                    objCS = LK_Inst_CourseScheduleDAL.SelectLK_Inst_CourseScheduleById(Convert.ToInt32(strTCSID));
                    if (objCS != null)
                    {
                        clsUser objUser = new clsUser();
                        objUser = UserDAL.SelectUserById(objCS.AuthorisedUserId);
                        if (objUser != null)
                        {
                            lblCrouseName.Text = objUser.FName + " " + objUser.LName;
                        }
                    }
                    #endregion

                    #region Checking if this records is already saved.
                    List <clsCourse_Result> objCRsave = new List <clsCourse_Result>();
                    objCRsave = Course_ResultDAL.SelectDynamicCourse_Result("Inst_CourseSchId = " + strTCSID + "", "ClassResultId");
                    if (objCRsave != null)
                    {
                        if (objCRsave.Count > 0)
                        {
                            // this records already exsistes
                            btnAddTManual.Enabled  = false;
                            dropAttendence.Enabled = false;
                            dropPassFail.Enabled   = false;
                            dropScore.Enabled      = false;
                        }
                        else
                        {
                            btnAddTManual.Enabled  = true;
                            dropAttendence.Enabled = true;
                            dropPassFail.Enabled   = true;
                            dropScore.Enabled      = true;
                        }
                    }

                    #endregion

                    //strTCid = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(strTCid.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(9, "bar", "Inst_MgmtCourses.aspx?dash=active") + "</div>"));
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                #region User and Company Info
                clsUser objEmp = new clsUser();
                objEmp = UserDAL.SelectUserById(Convert.ToInt32(Session["UserAuthId"].ToString()));

                #endregion

                #region Getting User Info
                // for side menu. if 3 hide. else show.
                if (objEmp != null)
                {
                    if (GlobalMethods.ValueIsNull(objEmp.ImageURL).Length > 0)
                    {
                        // phProfileImg.Controls.Add(new LiteralControl("<img src='" + objEmp.ImageURL.ToEncryptUrl() + "' width='35%' class='img-circle m-b m-t-md, img-responsive' alt='" + GlobalMethods.stringToMixedCase(objEmp.FName + " " + objEmp.LName) + "'>"));
                        //lblUserName.Text = "<span>" + GlobalMethods.stringToMixedCase(objEmp.FName + " " + objEmp.LName).ToUpper() + "</span>";
                        // lblUserIs.Text = "<span>" + GlobalMethods.stringToMixedCase(objEmp.FName + " " + objEmp.LName) + "</span>";
                        //lblDateJoin.Text = Convert.ToDateTime(objEmp.CreatedDate).ToLongDateString();
                    }
                    else
                    {
                        //  phProfileImg.Controls.Add(new LiteralControl("<img src='CSSBackEnd/img/imagemissing.png' width='35%' class='img-circle m-b m-t-md, img-responsive' alt='" + GlobalMethods.stringToMixedCase(objEmp.FName + " " + objEmp.LName) + "'>"));
                        //  lblUserName.Text = "<span>" + GlobalMethods.stringToMixedCase(objEmp.FName + " " + objEmp.LName).ToUpper() + "</span>";
                        //  lblUserIs.Text = "<span>" + GlobalMethods.stringToMixedCase(objEmp.FName + " " + objEmp.LName) + "</span>";
                        //  lblDateJoin.Text = Convert.ToDateTime(objEmp.CreatedDate).ToLongDateString();
                    }
                    //pnlMDEAccess
                    #region Now getting all the UserRole and making sure buttons are displayed accordingly.
                    List <clsUserRole> lstURole = new List <clsUserRole>();
                    lstURole = UserRoleDAL.SelectDynamicUserRole("AuthorizedUserId = " + objEmp.AuthorisedUserId + "", "UserRoleId");
                    if (lstURole != null)
                    {
                        if (lstURole.Count > 0)
                        {
                            for (int i = 0; i < lstURole.Count; i++)
                            {
                                // This is MDE Role
                            }
                        }
                    }
                    #endregion

                    #region Getting all the totals for dashboard
                    List <clsCategory> lstMDECourse = new List <clsCategory>();
                    lstMDECourse = CategoryDAL.SelectAllCategory();
                    if (lstMDECourse != null)
                    {
                        if (lstMDECourse.Count > 0)
                        {
                            TotalMDECourses = lstMDECourse.Count.ToString();
                        }
                    }
                    #endregion

                    #region Getting all the Pending Contractor Acc Applications
                    TotalContractorPendingApps = "0";

                    List <dynamic> lstValues;
                    string         strSQL = @"SELECT        tbl_SP_Contractor.SPContractorID, tbl_SP_Contractor.ACRDCatID, tbl_SP_Contractor.SPName, tbl_SP_Contractor.AccreditationID, tbl_SP_Contractor.AccreditationExpirationDate, 
                                tbl_SP_Contractor.IsActive, tbl_Category.CatTitle, tbl_SP_Contractor.CreatedDate
                                FROM            tbl_SP_Contractor INNER JOIN
                                tbl_Category ON tbl_SP_Contractor.ACRDCatID = tbl_Category.ACRDCatID
                                WHERE        (tbl_SP_Contractor.SPContractorID NOT IN
                                (SELECT        SPContractorID
                                FROM            tbl_Contractor_Approval))";
                    var            objPar = new DynamicParameters();

                    try
                    {
                        //objPar.Add("@CompanyId", CompanyId, dbType: DbType.Int32);
                        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)
                                {
                                    TotalContractorPendingApps = lstValues.Count.ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    #region Getting all New Training Provider Application
                    TotalTP_Apps = "0";
                    List <dynamic> lstTPTotal;
                    string         strSQL3 = @"SELECT        tbl_TrainingProvider.TP_Name, tbl_TrainingProvider.TPId, tbl_TrainingProvider.CreatedDate, tbl_Instructor.AccreditationID, tbl_Instructor.AccreditationExpirationDate, tbl_Instructor.Instructor_FName, 
                         tbl_Instructor.Instructor_LName
FROM            tbl_TrainingProvider INNER JOIN
                         tbl_TP_Instructors ON tbl_TrainingProvider.TPId = tbl_TP_Instructors.TPId INNER JOIN
                         tbl_Instructor ON tbl_TP_Instructors.TP_InstructorListId = tbl_Instructor.InstructorId
WHERE        (tbl_TrainingProvider.TPId NOT IN
                             (SELECT        TPId
                               FROM            tbl_TP_Approval))";
                    var            objPar3 = new DynamicParameters();

                    try
                    {
                        //objPar.Add("@CompanyId", CompanyId, dbType: DbType.Int32);
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstTPTotal = db.Query <dynamic>(strSQL3, objPar3, commandType: CommandType.Text).ToList();
                            if (lstTPTotal != null)
                            {
                                if (lstTPTotal.Count > 0)
                                {
                                    TotalTP_Apps = lstTPTotal.Count.ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    #region Getting all the New Instructor Applications
                    List <dynamic> lstInstructorApps;
                    string         strSQL4 = @"SELECT        Instructor_FName, Instructor_LName, InstructorId, AccreditationID, AccreditationExpirationDate
FROM            tbl_Instructor
WHERE        (InstructorId NOT IN
                             (SELECT        InstructorId
                               FROM            tbl_Instructor_Approval))";
                    var            objPar4 = new DynamicParameters();

                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstInstructorApps = db.Query <dynamic>(strSQL4, objPar4, commandType: CommandType.Text).ToList();
                            if (lstInstructorApps != null)
                            {
                                if (lstInstructorApps.Count > 0)
                                {
                                    TotalInstructor_Apps = lstInstructorApps.Count.ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    #region Getting all the New Certifications.
                    List <clsCourse_Result> lstCR = new List <clsCourse_Result>();
                    lstCR = Course_ResultDAL.SelectDynamicCourse_Result("(IsActive = -1) and (Cast(Acct_Term as int) > 0)", "ClassResultId");
                    if (lstCR != null)
                    {
                        if (lstCR.Count > 0)
                        {
                            TotalMDECertifications = lstCR.Count.ToString();
                        }
                    }
                    #endregion

                    #region Getting New Inspector and Risk Assessor
                    TotalRisk_Apps = "0";
                    List <dynamic> lstRiskAssesorApps;
                    string         strSQL6 = @"SELECT InspectorRiskAssId
                                       FROM  tbl_Inspector_RiskAssessor
                                      WHERE (InspectorRiskAssId NOT IN
                             (SELECT        InspectorRiskAssId
                               FROM    tbl_RiskAssessor_Approval))";
                    var            objPar6 = new DynamicParameters();

                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstRiskAssesorApps = db.Query <dynamic>(strSQL6, objPar6, commandType: CommandType.Text).ToList();
                            if (lstRiskAssesorApps != null)
                            {
                                if (lstRiskAssesorApps.Count > 0)
                                {
                                    TotalRisk_Apps = lstRiskAssesorApps.Count.ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    #region Getting New Supervisor
                    TotalSuper_Apps = "0";
                    List <dynamic> lstSuper_Apps;
                    string         strSQL7 = @"SELECT SupervisorId
                                       FROM  tbl_Supervisor
                                      WHERE (SupervisorId NOT IN
                             (SELECT        SupervisorId
                               FROM     tbl_Supervisor_Approval))";
                    var            objPar7 = new DynamicParameters();

                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstSuper_Apps = db.Query <dynamic>(strSQL7, objPar7, commandType: CommandType.Text).ToList();
                            if (lstSuper_Apps != null)
                            {
                                if (lstSuper_Apps.Count > 0)
                                {
                                    TotalSuper_Apps = lstSuper_Apps.Count.ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion

                    #region Getting New Training Courses
                    TotalTrainingCourses = "0";
                    List <dynamic> lstTCourses;
                    string         strSQL8 = @"SELECT TrainingCourseAppId
                                       FROM  tbl_TrainingCourse
                                      WHERE (TrainingCourseAppId NOT IN
                             (SELECT        TrainingCourseAppId
                               FROM     tbl_TrainingCourse_Approval))";
                    var            objPar8 = new DynamicParameters();

                    try
                    {
                        using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                        {
                            lstTCourses = db.Query <dynamic>(strSQL8, objPar8, commandType: CommandType.Text).ToList();
                            if (lstTCourses != null)
                            {
                                if (lstTCourses.Count > 0)
                                {
                                    TotalTrainingCourses = lstTCourses.Count.ToString();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.ErrorLogging(ex, false);
                        ErrorHandler.ReadError();
                    }
                    #endregion
                }
                #endregion
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strTCSID = string.Empty;
                string strTCid  = string.Empty;
                try
                {
                    strTCSID = Request["cgi"].ToString() == null ? string.Empty : Request["cgi"].ToString();
                    if (GlobalMethods.ValueIsNull(strTCSID).Length > 0)
                    {
                        strTCSID = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(Request["cgi"].ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                    }

                    #region Getting Class Details
                    clsCourse_Result objCS = new clsCourse_Result();
                    objCS = Course_ResultDAL.SelectCourse_ResultById(Convert.ToInt32(strTCSID));
                    if (objCS != null)
                    {
                        #region Getting Employer info
                        clsSP_Contractor objCont = new clsSP_Contractor();
                        objCont = SP_ContractorDAL.SelectSP_ContractorById(objCS.SPContractorID);
                        if (objCont != null)
                        {
                            lblEmployerName.Text  = objCont.SPName;
                            lblEmployerEmail.Text = objCont.SPEmail;
                            lblEmployerPhone.Text = objCont.SPPhone + " / " + objCont.SPMobile;
                        }
                        #endregion

                        lblYearFor.Text = objCS.Acct_Term.ToString();

                        clsUser objUser = new clsUser();
                        objUser = UserDAL.SelectUserById(objCS.AuthorisedUserId);
                        if (objUser != null)
                        {
                            lblCrouseName.Text = objUser.FName + " " + objUser.LName;
                        }

                        if (objCS.IsActive == 1)
                        {
                            // this records already exsistes
                            btnAddTManual.Enabled   = false;
                            dropEmpVerify.Enabled   = false;
                            dropPayment.Enabled     = false;
                            dropFinalStatus.Enabled = false;
                            dropBackGround.Enabled  = false;
                            txtNotes.Enabled        = false;

                            //strTCid = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(strTCid.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                            pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'><a class='btn btn-success download' title='Download as PDF' href='/" + objcryptoJS.AES_encrypt("Acct_Certificate", AppConstants.secretKey, AppConstants.initVec) + ".cert' target='_blank' >Generate Accreditation Certificate</a>" + GlobalMethods.ContractorAppStatus(1, "bar", "MDE_ApprCertApps.aspx?approvecertapp=active") + "</div>"));
                        }
                        else
                        {
                            btnAddTManual.Enabled   = true;
                            dropEmpVerify.Enabled   = true;
                            dropPayment.Enabled     = true;
                            dropFinalStatus.Enabled = true;
                            dropBackGround.Enabled  = true;
                            txtNotes.Enabled        = true;
                            //strTCid = objcryptoJS.AES_encrypt(HttpUtility.UrlEncode(strTCid.ToString()), AppConstants.secretKey, AppConstants.initVec).ToString();
                            pnlAppStatus.Controls.Add(new LiteralControl("<div class='input-group'><div class='input-group-btn'>" + GlobalMethods.ContractorAppStatus(9, "bar", "MDE_ApprCertApps.aspx?approvecertapp=active") + "</div>"));
                        }
                    }
                    #endregion
                }
                catch (Exception)
                {
                    ErrorHandler.ErrorPage();
                }
            }
        }