Ejemplo n.º 1
0
    private void LoadData()
    {
        if (Session["svid"] != null)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (sv.Load(Session["svid"].ToString(), ""))
            {
                this.Q2.Text = sv.Email;
                this.Q4.Text = sv.Company;
                this.Q5.Text = sv.Department;
                this.Q6.Text = sv.Name;
                this.Q8.Text = sv.Title;
                this.Q9.Text = sv.People;
                string tel = sv.Tel, tel1 = "", tel2 = "";

                if (tel.IndexOf(")") > -1)
                {
                    tel1 = tel.Substring(1, tel.IndexOf(")") - 1);
                    tel  = tel.Substring(tel.IndexOf(")") + 1);
                }
                if (tel.IndexOf("#") > -1)
                {
                    tel2 = tel.Substring(tel.IndexOf("#") + 1);
                    tel  = tel.Substring(0, tel.IndexOf("#") - 1);
                }
                this.Q7_0.Text = tel1;
                this.Q7_1.Text = tel;
                this.Q7_2.Text = tel2;

                #region Load Data

                DataRow[] drs = sv.SurveyData.Select("seq>='10' AND seq<='24'");
                for (int x = 0; x < drs.Length; x++)
                {
                    int seq = int.Parse(drs[x]["seq"].ToString());
                    if (seq == 10 || seq == 21)
                    {
                        string[] items = drs[x]["ans"].ToString().Split(';');
                        for (int y = 0; y < items.Length; y++)
                        {
                            CheckBox cb = Panel_Ans.FindControl("Q" + seq.ToString() + "_" + items[y].ToString()) as CheckBox;
                            cb.Checked = true;
                        }
                    }
                    else if ((seq >= 11 && seq <= 20) || seq == 22)
                    {
                        TextBox tb = Panel_Ans.FindControl("Q" + seq.ToString()) as TextBox;
                        tb.Text = drs[x]["ans"].ToString();
                    }
                    else
                    {
                        RadioButton rb = Panel_Ans.FindControl("Q" + seq.ToString() + "_" + drs[x]["ans"].ToString()) as RadioButton;
                        rb.Checked = true;
                    }
                }

                #endregion
            }
        }
    }
Ejemplo n.º 2
0
    private void LoadData()
    {
        if (Session["svid"] != null)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (sv.Load(Session["svid"].ToString(), ""))
            {
                #region Load Data

                DataRow[] drs = sv.SurveyData.Select("seq>='343' AND seq<='345'");

                for (int x = 0; x < drs.Length; x++)
                {
                    for (int y = 0; y < rdoitem.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == rdoitem[y])
                        {
                            RadioButton rb = Panel_Ans.FindControl("Q" + rdoitem[y] + "_" + drs[x]["ans"].ToString()) as RadioButton;
                            if (rb != null)
                            {
                                rb.Checked = true;
                            }
                            break;
                        }
                    }
                }

                #endregion
            }
        }
    }
Ejemplo n.º 3
0
    private void LoadData()
    {
        if (Session["svid"] != null)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (sv.Load(Session["svid"].ToString(), ""))
            {
                #region Load Data

                DataRow[] drs = sv.SurveyData.Select("seq>='27' AND seq<='48'");

                for (int x = 0; x < drs.Length; x++)
                {
                    for (int y = 0; y < ddlitem.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == ddlitem[y])
                        {
                            DropDownList ddl = Panel_Ans.FindControl("Q" + ddlitem[y]) as DropDownList;
                            if (ddl != null)
                            {
                                ddl.SelectedValue = drs[x]["ans"].ToString();
                            }
                            break;
                        }
                    }

                    for (int y = 0; y < txtitem.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == txtitem[y])
                        {
                            TextBox tb = Panel_Ans.FindControl("Q" + txtitem[y]) as TextBox;
                            if (tb != null)
                            {
                                tb.Text = drs[x]["ans"].ToString();
                            }
                            break;
                        }
                    }
                    for (int y = 0; y < rdoitem.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == rdoitem[y])
                        {
                            RadioButton rb = Panel_Ans.FindControl("Q" + rdoitem[y] + "_" + drs[x]["ans"].ToString()) as RadioButton;
                            if (rb != null)
                            {
                                rb.Checked = true;
                            }
                            break;
                        }
                    }
                }

                #endregion
            }
        }
    }
Ejemplo n.º 4
0
    private void SaveData()
    {
        CheckInput();
        if (this.PopupMessage1.Length == 0)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (Session["svid"] != null || !String.IsNullOrEmpty(Session["svid"].ToString()))
            {
                sv.ID = Session["svid"].ToString();
            }

            DataTable dt = new DataTable();
            dt.Columns.Add("seq");
            dt.Columns.Add("ans");


            #region DropDownList

            DataRow[] drd = dtq.Select("type='D'");

            for (int x = 0; x < drd.Length; x++)
            {
                DropDownList ddl = Panel_Ans.FindControl("Q" + drd[x]["seq"].ToString()) as DropDownList;
                if (ddl != null && !String.IsNullOrEmpty(ddl.SelectedValue))
                {
                    AddItem(ref dt, drd[x]["seq"].ToString(), ddl.Text);
                }
            }

            #endregion

            #region Radio

            DataRow[] drr = dtq.Select("type='R'");

            for (int x = 0; x < drr.Length; x++)
            {
                for (int y = 0; y < 10; y++)
                {
                    RadioButton rb = Panel_Ans.FindControl("Q" + drr[x]["seq"].ToString() + "_" + y.ToString()) as RadioButton;
                    if (rb != null && rb.Checked)
                    {
                        AddItem(ref dt, drr[x]["seq"].ToString(), y.ToString());
                        break;
                    }
                }
            }

            #endregion

            sv.SurveyData = dt;
            sv.SaveDetail(seqs, seqe);
        }
    }
Ejemplo n.º 5
0
    private void SaveData()
    {
        CheckInput();
        if (this.PopupMessage1.Length == 0)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (Session["svid"] != null || !String.IsNullOrEmpty(Session["svid"].ToString()))
            {
                sv.ID = Session["svid"].ToString();
            }

            DataTable dt = new DataTable();
            dt.Columns.Add("seq");
            dt.Columns.Add("ans");

            string Q296 = "";
            for (int x = 1; x < 6; x++)
            {
                TextBox tb = Panel_Ans.FindControl("Q296_" + x.ToString()) as TextBox;
                if (!String.IsNullOrEmpty(Q296))
                {
                    Q296 += ">";
                }
                if (tb != null && !String.IsNullOrEmpty(tb.Text))
                {
                    Q296 += tb.Text;
                }
            }
            if (!String.IsNullOrEmpty(Q296))
            {
                AddItem(ref dt, "296", Q296);
            }

            #region Text

            for (int x = 0; x < txtitem.Length; x++)
            {
                TextBox tb = Panel_Ans.FindControl("Q" + txtitem[x]) as TextBox;
                if (tb != null && !String.IsNullOrEmpty(tb.Text))
                {
                    AddItem(ref dt, txtitem[x], tb.Text);
                }
            }

            #endregion

            sv.SurveyData = dt;
            sv.SaveDetail(296, 297);
        }
    }
Ejemplo n.º 6
0
    private void LoadData()
    {
        if (Session["svid"] != null)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (sv.Load(Session["svid"].ToString(), ""))
            {
                #region Load Data

                DataRow[] drs = sv.SurveyData.Select("seq>='296' AND seq<='297'");

                for (int x = 0; x < drs.Length; x++)
                {
                    if (drs[x]["seq"].ToString() == "296")
                    {
                        string[] Q296 = drs[x]["ans"].ToString().Split('>');
                        if (Q296.Length > 0)
                        {
                            for (int z = 0; z < Q296.Length; z++)
                            {
                                TextBox tb = Panel_Ans.FindControl("Q296_" + (z + 1).ToString()) as TextBox;
                                if (tb != null)
                                {
                                    tb.Text = Q296[z];
                                }
                            }
                        }
                        continue;
                    }

                    for (int y = 0; y < txtitem.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == txtitem[y])
                        {
                            TextBox tb = Panel_Ans.FindControl("Q" + txtitem[y]) as TextBox;
                            if (tb != null)
                            {
                                tb.Text = drs[x]["ans"].ToString();
                            }
                            break;
                        }
                    }
                }

                #endregion
            }
        }
    }
Ejemplo n.º 7
0
    private void SaveData()
    {
        CheckInput();
        if (this.PopupMessage1.Length == 0)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (Session["svid"] != null || !String.IsNullOrEmpty(Session["svid"].ToString()))
            {
                sv.ID = Session["svid"].ToString();
            }

            DataTable dt = new DataTable();
            dt.Columns.Add("seq");
            dt.Columns.Add("ans");

            #region Radio


            for (int x = 0; x < rdoitem.Length; x++)
            {
                for (int y = 0; y < 10; y++)
                {
                    RadioButton rb = Panel_Ans.FindControl("Q" + rdoitem[x] + "_" + y.ToString()) as RadioButton;
                    if (rb != null && rb.Checked)
                    {
                        AddItem(ref dt, rdoitem[x], y.ToString());
                        break;
                    }
                }
            }

            #endregion

            sv.SurveyData = dt;
            sv.SaveDetail(343, 345);
        }
    }
Ejemplo n.º 8
0
    private void SaveData()
    {
        CheckInput();
        if (this.PopupMessage1.Length == 0)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (Session["svid"] != null || !String.IsNullOrEmpty(Session["svid"].ToString()))
            {
                sv.ID = Session["svid"].ToString();
            }

            DataTable dt = new DataTable();
            dt.Columns.Add("seq");
            dt.Columns.Add("ans");

            #region DropDownList

            for (int x = 0; x < ddlitem.Length; x++)
            {
                DropDownList ddl = Panel_Ans.FindControl("Q" + ddlitem[x]) as DropDownList;
                if (ddl != null && !String.IsNullOrEmpty(ddl.SelectedValue))
                {
                    AddItem(ref dt, ddlitem[x], ddl.Text);
                }
            }

            #endregion

            #region CheckBox


            for (int x = 0; x < chkitem.Length; x++)
            {
                CheckBox cb = Panel_Ans.FindControl("Q" + chkitem[x]) as CheckBox;
                if (cb != null && cb.Checked)
                {
                    AddItem(ref dt, chkitem[x], "1");
                }
            }


            #endregion

            #region Text

            for (int x = 0; x < txtitem.Length; x++)
            {
                TextBox tb = Panel_Ans.FindControl("Q" + txtitem[x]) as TextBox;
                if (tb != null && !String.IsNullOrEmpty(tb.Text))
                {
                    AddItem(ref dt, txtitem[x], tb.Text);
                }
            }

            #endregion

            #region Radio


            for (int x = 0; x < rdoitem.Length; x++)
            {
                for (int y = 0; y < 10; y++)
                {
                    RadioButton rb = Panel_Ans.FindControl("Q" + rdoitem[x] + "_" + y.ToString()) as RadioButton;
                    if (rb != null && rb.Checked)
                    {
                        AddItem(ref dt, rdoitem[x], y.ToString());
                        break;
                    }
                }
            }

            #endregion

            sv.SurveyData = dt;
            sv.SaveDetail(320, 340);
        }
    }
Ejemplo n.º 9
0
    private void LoadData()
    {
        if (Session["svid"] != null)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            if (sv.Load(Session["svid"].ToString(), ""))
            {
                #region Load Data

                DataRow[] drs = sv.SurveyData.Select("seq>='" + seqs.ToString() + "' AND seq<='" + seqe.ToString() + "'");
                DataRow[] drc = dtq.Select("type='C'");
                DataRow[] drd = dtq.Select("type='D'");
                DataRow[] drt = dtq.Select("type='T'");
                DataRow[] drr = dtq.Select("type='R'");

                for (int x = 0; x < drs.Length; x++)
                {
                    #region Items

                    for (int y = 0; y < drc.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == drc[y]["seq"].ToString())
                        {
                            CheckBox cb = Panel_Ans.FindControl("Q" + drc[y]["seq"].ToString()) as CheckBox;
                            if (cb != null && drs[x]["ans"].ToString() == "1")
                            {
                                cb.Checked = true;
                            }
                        }
                    }
                    for (int y = 0; y < drd.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == drd[y]["seq"].ToString())
                        {
                            DropDownList ddl = Panel_Ans.FindControl("Q" + drd[y]["seq"].ToString()) as DropDownList;
                            if (ddl != null)
                            {
                                ddl.SelectedValue = drs[x]["ans"].ToString();
                            }
                            break;
                        }
                    }
                    for (int y = 0; y < drt.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == drt[y]["seq"].ToString())
                        {
                            TextBox tb = Panel_Ans.FindControl("Q" + drt[y]["seq"].ToString()) as TextBox;
                            if (tb != null)
                            {
                                tb.Text = drs[x]["ans"].ToString();
                            }
                            break;
                        }
                    }
                    for (int y = 0; y < drr.Length; y++)
                    {
                        if (drs[x]["seq"].ToString() == drr[y]["seq"].ToString())
                        {
                            RadioButton rb = Panel_Ans.FindControl("Q" + drr[y]["seq"].ToString() + "_" + drs[x]["ans"].ToString()) as RadioButton;
                            if (rb != null)
                            {
                                rb.Checked = true;
                            }
                            break;
                        }
                    }

                    #endregion
                }

                #endregion
            }
        }
    }
Ejemplo n.º 10
0
    private void SaveData()
    {
        CheckInput();
        if (this.PopupMessage1.Length == 0)
        {
            YPSCS.Class.Survey sv = new YPSCS.Class.Survey();
            sv.SurveyCode = Session["svcode"].ToString();
            if (Session["svid"] == null || String.IsNullOrEmpty(Session["svid"].ToString()))
            {
                sv.ID           = Guid.NewGuid().ToString().ToUpper();
                Session["svid"] = sv.ID;
            }
            else
            {
                sv.ID = Session["svid"].ToString();
            }
            sv.Email      = this.Q2.Text;
            sv.Company    = this.Q4.Text;
            sv.Department = this.Q5.Text;
            sv.Name       = this.Q6.Text;
            sv.Tel        = (String.IsNullOrEmpty(this.Q7_0.Text) ? "" : "(" + this.Q7_0.Text + ")") + this.Q7_1.Text + (String.IsNullOrEmpty(this.Q7_2.Text) ? "" : " #" + this.Q7_2.Text);
            sv.Title      = this.Q8.Text;
            sv.People     = this.Q9.Text;
            sv.Language   = System.Web.HttpContext.Current.Request.UserLanguages[0].ToString();

            sv.Create();

            DataTable dt = new DataTable();
            dt.Columns.Add("seq");
            dt.Columns.Add("ans");

            #region A.2

            string Q10 = "";
            for (int x = 1; x <= 10; x++)
            {
                CheckBox cb = Panel_Ans.FindControl("Q10_" + x.ToString()) as CheckBox;
                if (cb != null && cb.Checked)
                {
                    AddString(ref Q10, x.ToString());
                }
            }
            for (int x = 11; x <= 20; x++)
            {
                TextBox tb = Panel_Ans.FindControl("Q" + x.ToString()) as TextBox;
                if (tb != null && !String.IsNullOrEmpty(tb.Text))
                {
                    AddItem(ref dt, x.ToString(), tb.Text);
                }
            }

            if (!String.IsNullOrEmpty(Q10))
            {
                AddItem(ref dt, "10", Q10);
            }

            #endregion

            #region A.3

            string Q21 = "";
            for (int x = 1; x <= 8; x++)
            {
                CheckBox cb = Panel_Ans.FindControl("Q21_" + x.ToString()) as CheckBox;
                if (cb != null && cb.Checked)
                {
                    AddString(ref Q21, x.ToString());
                }
            }
            if (!String.IsNullOrEmpty(Q10))
            {
                AddItem(ref dt, "21", Q21);
            }
            if (!String.IsNullOrEmpty(this.Q22.Text))
            {
                AddItem(ref dt, "22", this.Q22.Text);
            }

            #endregion

            #region A.4

            for (int x = 1; x <= 6; x++)
            {
                RadioButton rb = Panel_Ans.FindControl("Q23_" + x.ToString()) as RadioButton;
                if (rb != null && rb.Checked)
                {
                    AddItem(ref dt, "23", x.ToString());
                    break;
                }
            }

            #endregion

            #region A.5

            for (int x = 1; x <= 5; x++)
            {
                RadioButton rb = Panel_Ans.FindControl("Q24_" + x.ToString()) as RadioButton;
                if (rb != null && rb.Checked)
                {
                    AddItem(ref dt, "24", x.ToString());
                    break;
                }
            }

            #endregion

            sv.SurveyData = dt;
            sv.SaveDetail(10, 24);
        }
    }