예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    storeId = HiContext.Current.Manager.StoreId;
            string storeSlideImagesByStoreId = DepotHelper.GetStoreSlideImagesByStoreId(storeId);

            this.hidOldImages.Value = storeSlideImagesByStoreId;
            IList <StoreFloorInfo> storeFloorList = StoresHelper.GetStoreFloorList(storeId, FloorClientType.O2OApplet);
            int           pageIndex       = 1;
            int           pageSize        = 1000000000;
            DbQueryResult showProductList = WeChartAppletHelper.GetShowProductList(0, pageIndex, pageSize, storeId, ProductType.ServiceProduct);
            DataTable     data            = showProductList.Data;
            StringBuilder stringBuilder   = new StringBuilder();

            for (int i = 0; i < data.Rows.Count; i++)
            {
                if (stringBuilder.Length > 0)
                {
                    stringBuilder.Insert(0, data.Rows[i]["ProductId"] + "|||" + data.Rows[i]["ProductName"] + ",,,");
                }
                else
                {
                    stringBuilder.Append(data.Rows[i]["ProductId"] + "|||" + data.Rows[i]["ProductName"]);
                }
            }
            this.hidSelectProducts.Value  = stringBuilder.ToString();
            this.lkbAddAppletFloor.Click += this.lkbAddAppletFloor_Click;
        }
예제 #2
0
        public void GetAppletFloorList(HttpContext context)
        {
            int storeId = HiContext.Current.Manager.StoreId;
            IList <StoreFloorInfo> storeFloorList = StoresHelper.GetStoreFloorList(storeId, FloorClientType.O2OApplet);
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            dataGridViewModel.rows  = DataHelper.ListToDictionary(storeFloorList);
            dataGridViewModel.total = 10000;
            string s = base.SerializeObjectToJson(dataGridViewModel);

            context.Response.Write(s);
            context.Response.End();
        }
예제 #3
0
        private void GetStoreFloors(HttpContext context)
        {
            StoreFloorQuery storeFloorQuery = new StoreFloorQuery();

            storeFloorQuery.PageIndex = context.Request["pageIndex"].ToInt(0);
            storeFloorQuery.PageSize  = context.Request["pageSize"].ToInt(0);
            int storeID = 0;

            int.TryParse(context.Request["storeId"], out storeID);
            storeFloorQuery.StoreID     = storeID;
            storeFloorQuery.ProductType = ProductType.All;
            PageModel <StoreFloorInfo> storeFloorList = StoresHelper.GetStoreFloorList(storeFloorQuery);
            string s = JsonConvert.SerializeObject(storeFloorList);

            context.Response.ContentType = "text/json";
            context.Response.Write(s);
        }
예제 #4
0
 public override void OnLoad(HttpContext context)
 {
     base.OnLoad(context);
     if (context.Request["flag"] == "Select")
     {
         IList <StoreFloorInfo> storeFloorList = StoresHelper.GetStoreFloorList(base.CurrentManager.StoreId, FloorClientType.Mobbile);
         string s2 = JsonConvert.SerializeObject(new
         {
             Result = from s in storeFloorList
                      select new
             {
                 s.FloorId,
                 s.FloorName,
                 s.DisplaySequence,
                 s.Quantity
             }
         });
         context.Response.Write(s2);
         context.Response.End();
     }
     if (context.Request["flag"] == "Add")
     {
         int    storeId = base.CurrentManager.StoreId;
         string text    = context.Request["FloorName"].ToNullString();
         int    imageId = context.Request["ImageId"].ToInt(0);
         string text2   = context.Request["ProductIds"].ToNullString();
         if (text.Trim().Length < 1 || text.Trim().Length > 12)
         {
             context.Response.Write(this.GetErrorJosn(101, "楼层名称不能为空,且在1-12个字符之间"));
             return;
         }
         StoreFloorInfo storeFloorInfo = new StoreFloorInfo();
         storeFloorInfo.StoreId         = storeId;
         storeFloorInfo.FloorName       = text;
         storeFloorInfo.ImageId         = imageId;
         storeFloorInfo.FloorClientType = FloorClientType.Mobbile;
         int floorId = StoresHelper.AddStoreFloor(storeFloorInfo);
         if (!string.IsNullOrEmpty(text2))
         {
             StoresHelper.BindStoreFloorProducts(floorId, storeId, text2);
         }
         string s3 = JsonConvert.SerializeObject(new
         {
             Result = new
             {
                 Success = new
                 {
                     Status = true,
                     Msg    = string.Empty
                 }
             }
         });
         context.Response.Write(s3);
         context.Response.End();
     }
     if (context.Request["flag"] == "Mdy")
     {
         int    storeId2 = base.CurrentManager.StoreId;
         int    num      = context.Request["FloorId"].ToInt(0);
         string text3    = context.Request["FloorName"].ToNullString();
         int    imageId2 = context.Request["ImageId"].ToInt(0);
         string text4    = context.Request["ProductIds"].ToNullString();
         if (num <= 0)
         {
             context.Response.Write(this.GetErrorJosn(101, ((Enum)(object)ApiErrorCode.Paramter_Error).ToDescription()));
             return;
         }
         if (text3.Trim().Length < 1 || text3.Trim().Length > 12)
         {
             context.Response.Write(this.GetErrorJosn(101, "楼层名称不能为空,且在1-12个字符之间"));
             return;
         }
         StoreFloorInfo storeFloorInfo2 = new StoreFloorInfo();
         storeFloorInfo2                 = StoresHelper.GetStoreFloorBaseInfo(num);
         storeFloorInfo2.FloorName       = text3;
         storeFloorInfo2.ImageId         = imageId2;
         storeFloorInfo2.FloorClientType = FloorClientType.Mobbile;
         StoresHelper.UpdateStoreFloor(storeFloorInfo2);
         if (!string.IsNullOrEmpty(text4))
         {
             StoresHelper.BindStoreFloorProducts(num, storeId2, text4);
         }
         string s4 = JsonConvert.SerializeObject(new
         {
             Result = new
             {
                 Success = new
                 {
                     Status = true,
                     Msg    = string.Empty
                 }
             }
         });
         context.Response.Write(s4);
         context.Response.End();
     }
     if (context.Request["flag"] == "Delete")
     {
         int storeId3 = base.CurrentManager.StoreId;
         int num2     = context.Request["FloorId"].ToInt(0);
         if (num2 <= 0)
         {
             context.Response.Write(this.GetErrorJosn(101, ((Enum)(object)ApiErrorCode.Paramter_Error).ToDescription()));
             return;
         }
         StoresHelper.DeleteStoreFloor(num2);
         string s5 = JsonConvert.SerializeObject(new
         {
             Result = new
             {
                 Success = new
                 {
                     Status = true,
                     Msg    = string.Empty
                 }
             }
         });
         context.Response.Write(s5);
         context.Response.End();
     }
     if (context.Request["flag"] == "SetDisplaySequence")
     {
         int storeId4 = base.CurrentManager.StoreId;
         int num3     = context.Request["FloorId"].ToInt(0);
         if (num3 <= 0)
         {
             context.Response.Write(this.GetErrorJosn(101, ((Enum)(object)ApiErrorCode.Paramter_Error).ToDescription()));
         }
         else
         {
             int            displaySequence    = context.Request["DisplaySequence"].ToInt(0);
             StoreFloorInfo storeFloorBaseInfo = StoresHelper.GetStoreFloorBaseInfo(num3);
             if (storeFloorBaseInfo == null)
             {
                 context.Response.Write(this.GetErrorJosn(101, "错误的楼层ID"));
             }
             else
             {
                 storeFloorBaseInfo.DisplaySequence = displaySequence;
                 StoresHelper.UpdateStoreFloor(storeFloorBaseInfo);
                 string s6 = JsonConvert.SerializeObject(new
                 {
                     Result = new
                     {
                         Success = new
                         {
                             Status = true,
                             Msg    = string.Empty
                         }
                     }
                 });
                 context.Response.Write(s6);
                 context.Response.End();
             }
         }
     }
 }