//protected void lbtnAttachFile_Click(object sender, EventArgs e)
        //{
        //    if (ViewState["PathFile"] != null)
        //    {
        //        string _pathfile = (string)ViewState["PathFile"];
        //        DownloadAttachFile(_pathfile);
        //    }
        //}

        protected void btnAccept_Click(object sender, EventArgs e)
        {
            if (Session["UserLogin"] == null)
            {
                Response.Redirect("~/Account/Login.aspx");
            }
            else
            {
                /******************************************/
                //// Check Questionnaire ///////////////////
                /******************************************/

                MAS_COMPANYUSER_DTO retUser = (MAS_COMPANYUSER_DTO)Session["UserLogin"];
                if (retUser.RolesNo > 0)
                {
                    hdfCompanyNo.Value = retUser.CompanyNo.ToString().Trim();
                    hdfUserName.Value  = retUser.UserName;
                    hdfUserNo.Value    = retUser.UsersNo.ToString().Trim();
                    hdfRoleNo.Value    = retUser.RolesNo.ToString();
                }

                Inf_Questionnaire_Manage manage  = new Inf_Questionnaire_Manage();
                INF_QUESTIONNAIRE        retData = new INF_QUESTIONNAIRE();
                retData.ProjectNo = hdfProjectNo.Value.Trim();
                retData.CompanyNo = hdfCompanyNo.Value.Trim();
                retData           = manage.GetQuestionaire(retData);
                if (retData != null && retData.QuestionNo > 0)
                {
                    Response.Redirect("~/Form/BiddingProcess.aspx?ProjectNo=" + hdfProjectNo.Value);
                }
                else
                {
                    //Response.Redirect("~/Form/Questionnaire.aspx?ProjectNo=" + hdfProjectNo.Value);
                    Response.Redirect("~/Form/UserRegister.aspx", true);
                }
                /*******************************************/
            }
        }
Пример #2
0
        protected void btnAccept_Click(object sender, EventArgs e)
        {
            logger.Info("btnAccept_Click() - Start");
            /************************ Insert Data *****************/
            bool ret = false;

            try
            {
                string _phoneNo = ConfigurationManager.GetConfiguration().GulfPhoneNo;

                if (!string.IsNullOrWhiteSpace(hdfProjectNo.Value) && !string.IsNullOrWhiteSpace(hdfCompanyNo.Value))
                {
                    Inf_Questionnaire_Manage bl      = new Inf_Questionnaire_Manage();
                    INF_QUESTIONNAIRE        insData = new INF_QUESTIONNAIRE();

                    insData.ProjectNo = hdfProjectNo.Value.Trim();
                    insData.CompanyNo = hdfCompanyNo.Value.Trim();

                    if (rdoQuestion1.SelectedIndex > -1)
                    {
                        insData.AnsQuestion1 = int.Parse(rdoQuestion1.SelectedValue);
                    }
                    if (rdoQuestion3.SelectedIndex > -1)
                    {
                        insData.AnsQuestion3 = int.Parse(rdoQuestion3.SelectedValue);
                    }
                    if (rdoQuestion4.SelectedIndex > -1)
                    {
                        insData.AnsQuestion4 = int.Parse(rdoQuestion4.SelectedValue);
                    }
                    if (rdoQuestion5.SelectedIndex > -1)
                    {
                        insData.AnsQuestion5 = int.Parse(rdoQuestion5.SelectedValue);
                    }
                    if (rdoQuestion6.SelectedIndex > -1)
                    {
                        insData.AnsQuestion6 = int.Parse(rdoQuestion6.SelectedValue);
                    }
                    if (rdoQuestion7.SelectedIndex > -1)
                    {
                        insData.AnsQuestion7 = int.Parse(rdoQuestion7.SelectedValue);
                    }

                    insData.AnsQuestion2 = "วันที่จดทะเบียน: " + txtRegisterDate.Text.Trim() + " ประสบการณ์: " + lblTotalYear.Text;

                    insData.AnsQuestion8 = txtQuestion8.Text.Trim();

                    insData.CreatedBy   = GetIPAddress();
                    insData.CreatedDate = DateTime.Now;
                    insData.UpdatedBy   = GetIPAddress();
                    insData.UpdatedDate = DateTime.Now;

                    ret = bl.InsertQuestionnaire(insData);

                    if (ret)
                    {
                        /************** Send Email UserName & Password ***************/
                        if (Session["EmailVendor"] != null)
                        {
                            this.lbtnPopup_ModalPopupExtender.Show();

                            INF_EMIALVENDOR mailData = new INF_EMIALVENDOR();
                            mailData = (INF_EMIALVENDOR)Session["EmailVendor"];

                            this.SendMailUserPassword(mailData.EmailBody, mailData.EmailTo);
                        }
                        /*************************************************************/

                        Session["IsAnswer"]  = "true";
                        Session["RegDetail"] = null;

                        //lblMsgResult1.Text = "บันทึกข้อมูลสำเร็จ";
                        lblMsgResult1.Text = "ท่านได้ทำการลงทะเบียนเรียบร้อย ระบบจะจัดส่งข้อมูลผู้ใช้งานให้ทางอีเมล์ที่ได้ลงทะเบียนไว้<br />" +
                                             "หากไม่ได้รับอีเมล์ภายใน 1 วันสามารถติดต่อได้ที่เบอร์โทร " + _phoneNo;
                        this.lbtnPopup_ModalPopupExtender.Show();
                    }
                    else
                    {
                        Session["IsAnswer"] = "false";
                        //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ไม่สามารถบันทึกข้อมูลได้')", true);
                        //string _phoneNo = ConfigurationManager.GetConfiguration().GulfPhoneNo;

                        lblMsgResult1.Text = "ไม่สามารถบันทึกข้อมูลได้ <br /> กรุณาติดต่อผู้ดูแลระบบที่เบอร์ " + _phoneNo;
                        this.lbtnPopup_ModalPopupExtender.Show();
                    }
                }
                else
                {
                    logger.Info("Session UserLogin has no data..!");
                    Response.Redirect("~/Account/Login.aspx", true);
                }

                logger.Info("btnAccept_Click() - End");
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
            }
        }
Пример #3
0
        private void GetCompQuestionaire(string RoleNo)
        {
            try
            {
                MAS_COMPANYUSER_DTO _UserLogin = (MAS_COMPANYUSER_DTO)Session["UserLogin"];

                Inf_Questionnaire_Manage manage  = new Inf_Questionnaire_Manage();
                INF_QUESTIONNAIRE        retData = new INF_QUESTIONNAIRE();
                retData.ProjectNo = hdfProjectNo.Value.Trim();
                retData.CompanyNo = hdfCompanyNo.Value.Trim();

                retData = manage.GetQuestionaire(retData);
                if (retData.QuestionNo > 0)
                {
                    if ((!retData.CompanyNo.Trim().Equals(_UserLogin.CompanyNo.ToString().Trim()) ||
                         !retData.ProjectNo.Equals(_UserLogin.ProjectNo.ToString().Trim())) &&
                        (RoleNo.Trim().Equals("2")))
                    {
                        Session.Clear();
                        Session.Abandon();
                        ViewState.Clear();
                        FormsAuthentication.SignOut();

                        Response.Redirect("~/Account/Login.aspx", true);
                    }
                    else
                    {
                        Mas_BiddingCompany_Manage cManage = new Mas_BiddingCompany_Manage();
                        MAS_BIDDINGCOMPANY        comData = new MAS_BIDDINGCOMPANY();
                        comData         = cManage.GetBiddingCompany(retData.CompanyNo);
                        lblCompany.Text = comData.CompanyName;

                        if (retData.AnsQuestion1 != null)
                        {
                            lblQ1.Text = (retData.AnsQuestion1 == 1 ? "ใช่" : "ไม่ใช่");
                        }

                        lblQ2.Text = retData.AnsQuestion2;

                        if (retData.AnsQuestion3 != null)
                        {
                            lblQ3.Text = (retData.AnsQuestion3 == 1 ? "ใช่" : "ไม่ใช่");
                        }

                        if (retData.AnsQuestion4 != null)
                        {
                            lblQ4.Text = (retData.AnsQuestion4 == 1 ? "ใช่" : "ไม่ใช่");
                        }

                        if (retData.AnsQuestion5 != null)
                        {
                            lblQ5.Text = (retData.AnsQuestion5 == 1 ? "ใช่" : "ไม่ใช่");
                        }

                        if (retData.AnsQuestion6 != null)
                        {
                            lblQ6.Text = (retData.AnsQuestion6 == 1 ? "ใช่" : "ไม่ใช่");
                        }

                        if (retData.AnsQuestion7 != null)
                        {
                            lblQ7.Text = (retData.AnsQuestion7 == 1 ? "ใช่" : "ไม่ใช่");
                        }

                        if (!string.IsNullOrEmpty(retData.AnsQuestion8))
                        {
                            lblQ8.Text = retData.AnsQuestion8;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
            }
        }