Exemple #1
0
        public void UpdateAppletFloor(HttpContext context)
        {
            int    storeId = HiContext.Current.Manager.StoreId;
            int    num     = context.Request["FloorId"].ToInt(0);
            string text    = context.Request["FloorName"].ToNullString();
            int    imageId = 0;
            string text2   = context.Request["ProductIds"].ToNullString();

            if (num <= 0)
            {
                throw new HidistroAshxException("错误的楼层ID");
            }
            if (text.Trim().Length < 1 || text.Trim().Length > 10)
            {
                throw new HidistroAshxException("楼层名称不能为空,且在1-10个字符之间");
            }
            StoreFloorInfo storeFloorInfo = new StoreFloorInfo();

            storeFloorInfo = StoresHelper.GetStoreFloorBaseInfo(num);
            if (storeFloorInfo == null || storeFloorInfo.StoreId != storeId || storeFloorInfo.FloorClientType != FloorClientType.O2OApplet)
            {
                throw new HidistroAshxException("错误的楼层ID或者不是门店楼层");
            }
            storeFloorInfo.FloorName       = text;
            storeFloorInfo.ImageId         = imageId;
            storeFloorInfo.FloorClientType = FloorClientType.O2OApplet;
            StoresHelper.UpdateStoreFloor(storeFloorInfo);
            if (!string.IsNullOrEmpty(text2))
            {
                StoresHelper.BindStoreFloorProducts(num, storeId, text2);
            }
            base.ReturnSuccessResult(context, "修改成功", 0, true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int floorId = base.Request.QueryString["FloorId"].ToInt(0);

            this.txtFloorId.Value = floorId.ToString();
            StoreFloorInfo storeFloorBaseInfo = StoresHelper.GetStoreFloorBaseInfo(floorId);

            this.txtFloorName.Text       = storeFloorBaseInfo.FloorName;
            this.txtDisplaySequence.Text = storeFloorBaseInfo.DisplaySequence.ToString();
            IList <StoreProductBaseModel> products = storeFloorBaseInfo.Products;
            StringBuilder stringBuilder            = new StringBuilder();

            for (int i = 0; i < products.Count; i++)
            {
                if (stringBuilder.Length > 0)
                {
                    stringBuilder.Insert(0, products[i].ProductId + "|||" + products[i].ProductName + ",,,");
                }
                else
                {
                    stringBuilder.Append(products[i].ProductId + "|||" + products[i].ProductName);
                }
            }
            this.hidSelectProducts.Value = stringBuilder.ToString();
        }
Exemple #3
0
        public void AddAppletFloor(HttpContext context)
        {
            int    storeId = HiContext.Current.Manager.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 > 10)
            {
                throw new HidistroAshxException("楼层名称不能为空,且在1-10个字符之间");
            }
            StoreFloorInfo storeFloorInfo = new StoreFloorInfo();

            storeFloorInfo.StoreId         = storeId;
            storeFloorInfo.FloorName       = text;
            storeFloorInfo.ImageId         = imageId;
            storeFloorInfo.FloorClientType = FloorClientType.O2OApplet;
            int floorId = StoresHelper.AddStoreFloor(storeFloorInfo);

            if (!string.IsNullOrEmpty(text2))
            {
                StoresHelper.BindStoreFloorProducts(floorId, storeId, text2);
            }
            base.ReturnSuccessResult(context, "保存成功", 0, true);
        }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         int            floorId            = base.Request.QueryString["FloorId"].ToInt(0);
         StoreFloorInfo storeFloorBaseInfo = StoresHelper.GetStoreFloorBaseInfo(floorId);
         this.txtFloorName.Value = storeFloorBaseInfo.FloorName;
         this.spGLYXTP.InnerHtml = storeFloorBaseInfo.ImageName;
         HtmlGenericControl htmlGenericControl = this.spGLYXTPID;
         int num = storeFloorBaseInfo.ImageId;
         htmlGenericControl.InnerHtml = num.ToString();
         HtmlInputText htmlInputText = this.txtDisplaySequence;
         num = storeFloorBaseInfo.DisplaySequence;
         htmlInputText.Value = num.ToString();
         IList <StoreProductBaseModel> products = storeFloorBaseInfo.Products;
         StringBuilder stringBuilder            = new StringBuilder();
         for (int i = 0; i < products.Count; i++)
         {
             if (stringBuilder.Length > 0)
             {
                 stringBuilder.Insert(0, products[i].ProductId + "|||" + products[i].ProductName + ",,,");
             }
             else
             {
                 stringBuilder.Append(products[i].ProductId + "|||" + products[i].ProductName);
             }
         }
         this.hidSelectProducts.Value = stringBuilder.ToString();
     }
     catch (Exception ex)
     {
         base.Response.Write(ex.Message);
     }
 }
Exemple #5
0
        public void DeleteAppletFloor(HttpContext context)
        {
            int storeId = HiContext.Current.Manager.StoreId;
            int num     = context.Request["FloorId"].ToInt(0);

            if (num <= 0)
            {
                throw new HidistroAshxException("请选择要删除的楼层");
            }
            StoreFloorInfo storeFloorBaseInfo = StoresHelper.GetStoreFloorBaseInfo(num);

            if (storeFloorBaseInfo == null || storeFloorBaseInfo.StoreId != storeId || storeFloorBaseInfo.FloorClientType != FloorClientType.O2OApplet)
            {
                throw new HidistroAshxException("错误的楼层ID或者不是门店楼层");
            }
            StoresHelper.DeleteStoreFloor(num);
            base.ReturnSuccessResult(context, "删除楼层成功", 0, true);
        }
Exemple #6
0
        public void SetDisplaySequence(HttpContext context)
        {
            int storeId = HiContext.Current.Manager.StoreId;
            int num     = context.Request["FloorId"].ToInt(0);

            if (num <= 0)
            {
                throw new HidistroAshxException("错误的楼层ID");
            }
            int            displaySequence    = context.Request["DisplaySequence"].ToInt(0);
            StoreFloorInfo storeFloorBaseInfo = StoresHelper.GetStoreFloorBaseInfo(num);

            if (storeFloorBaseInfo == null || storeFloorBaseInfo.StoreId != storeId || storeFloorBaseInfo.FloorClientType != FloorClientType.O2OApplet)
            {
                throw new HidistroAshxException("错误的楼层ID或者不是门店楼层");
            }
            storeFloorBaseInfo.DisplaySequence = displaySequence;
            StoresHelper.UpdateStoreFloor(storeFloorBaseInfo);
            base.ReturnSuccessResult(context, "修改成功", 0, true);
        }
 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();
             }
         }
     }
 }