private void SaveDiscountProduct(HttpContext context)
 {
     Globals.RequestFormNum("id");
     foreach (string str2 in Globals.RequestFormStr("discountProductList").Trim(new char[] { ',' }).Split(new char[] { ',' }))
     {
         string[] strArray2 = str2.Split(new char[] { '^' });
         LimitedTimeDiscountProductInfo info = new LimitedTimeDiscountProductInfo();
         if (((!string.IsNullOrEmpty(strArray2[0]) && !string.IsNullOrEmpty(strArray2[1])) && !string.IsNullOrEmpty(strArray2[4])) && (!string.IsNullOrEmpty(strArray2[2]) || !string.IsNullOrEmpty(strArray2[3])))
         {
             int id = Globals.ToNum(strArray2[0]);
             LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(id);
             info.LimitedTimeDiscountId = id;
             info.ProductId             = Globals.ToNum(strArray2[1]);
             info.Discount   = (string.IsNullOrEmpty(strArray2[2]) || (strArray2[2] == "undefined")) ? 0M : decimal.Parse(strArray2[2]);
             info.Minus      = (string.IsNullOrEmpty(strArray2[3]) || (strArray2[2] == "undefined")) ? 0M : decimal.Parse(strArray2[3]);
             info.FinalPrice = decimal.Parse(strArray2[4]);
             if (discountInfo != null)
             {
                 info.BeginTime = discountInfo.BeginTime;
                 info.EndTime   = discountInfo.EndTime;
             }
             info.CreateTime = DateTime.Now;
             info.Status     = 1;
             LimitedTimeDiscountHelper.AddLimitedTimeDiscountProduct(info);
         }
     }
     context.Response.Write("{\"msg\":\"success\"}");
 }
        private void SaveDiscountProduct(System.Web.HttpContext context)
        {
            Globals.RequestFormNum("id");
            string text = Globals.RequestFormStr("discountProductList").Trim(new char[]
            {
                ','
            });

            string[] array = text.Split(new char[]
            {
                ','
            });
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string   text2  = array2[i];
                string[] array3 = text2.Split(new char[]
                {
                    '^'
                });
                LimitedTimeDiscountProductInfo limitedTimeDiscountProductInfo = new LimitedTimeDiscountProductInfo();
                if (!string.IsNullOrEmpty(array3[0]) && !string.IsNullOrEmpty(array3[1]) && !string.IsNullOrEmpty(array3[4]) && (!string.IsNullOrEmpty(array3[2]) || !string.IsNullOrEmpty(array3[3])))
                {
                    int num = Globals.ToNum(array3[0]);
                    LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(num);
                    limitedTimeDiscountProductInfo.LimitedTimeDiscountId = num;
                    limitedTimeDiscountProductInfo.ProductId             = Globals.ToNum(array3[1]);
                    limitedTimeDiscountProductInfo.Discount   = ((string.IsNullOrEmpty(array3[2]) || array3[2] == "undefined") ? 0m : decimal.Parse(array3[2]));
                    limitedTimeDiscountProductInfo.Minus      = ((string.IsNullOrEmpty(array3[3]) || array3[2] == "undefined") ? 0m : decimal.Parse(array3[3]));
                    limitedTimeDiscountProductInfo.FinalPrice = decimal.Parse(array3[4]);
                    if (discountInfo != null)
                    {
                        limitedTimeDiscountProductInfo.BeginTime = discountInfo.BeginTime;
                        limitedTimeDiscountProductInfo.EndTime   = discountInfo.EndTime;
                    }
                    limitedTimeDiscountProductInfo.CreateTime = System.DateTime.Now;
                    limitedTimeDiscountProductInfo.Status     = 1;
                    LimitedTimeDiscountHelper.AddLimitedTimeDiscountProduct(limitedTimeDiscountProductInfo);
                }
            }
            context.Response.Write("{\"msg\":\"success\"}");
        }