//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
        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);
            }
        }