コード例 #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Validation();
            if (lblError.Text == string.Empty)
            {
                string jsonFormatValue =
                    "{" +
                    lblQuestion1.Text + ":[" +

                    "{" +
                    lblOption1.Text + ":" +
                    txtOption1.Text
                    + "}" +
                    "{" +
                    lblOption2.Text + ":" +
                    txtOption2.Text
                    + "}" +
                    "{" +
                    lblOption3.Text + ":" +
                    txtOption3.Text
                    + "}" +
                    "{" +
                    lblOption4.Text + ":" +
                    txtOption4.Text
                    + "}]" +

                    "}" +
                    "{" +
                    lblQuestion2.Text + "[" +
                    "{" + lblOption5.Text + ":" + txtOption5.Text + "}" +
                    "{" + lblOption6.Text + ":" + txtOption6.Text + "}" +
                    "{" + lblOption7.Text + ":" + txtOption7.Text + "}" +
                    "{" +
                    lblOption8.Text + ":" +
                    txtOption8.Text
                    + "}" +
                    "]}" +

                    "}";

                ChinaPromotionProvider.SubmitPCPromoSurvey(ProductsBase.ShoppingCart.DistributorID, "CN", DateUtils.GetCurrentLocalTime("CN"),
                                                           convertDateTime(pInfo.FirstOrDefault(x => x.Code.Equals("PCPromoSurvey")).StartDate),
                                                           convertDateTime(pInfo.FirstOrDefault(x => x.Code.Equals("PCPromoSurvey")).EndDate),
                                                           "PCPromoSurvey", jsonFormatValue);
                Session["AttainedSurvey"] = true;
                Response.Redirect("Pricelist.aspx");
            }
        }