Esempio n. 1
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            string text = base.Request.Form["CheckBoxGroup"];

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请选择一件商品!", false);
                return;
            }
            string[] array = text.Split(new char[]
            {
                ','
            });
            int num = 0;

            string[] array2 = array;
            string   QRcode = string.Empty;

            for (int i = 0; i < array2.Length; i++)
            {
                string value = array2[i];
                QRcode = CreateQrcode("StoreId=" + StoreId + "&ProductId=" + value, StoreId.ToString() + "" + value);
                if (StoreManagementHelper.AddReleatesProdcutByStore(this.StoreId, System.Convert.ToInt32(value), QRcode.Replace("~", "")))
                {
                    num++;
                }
            }
            if (num > 0)
            {
                this.CloseWindow();
                return;
            }
            this.ShowMsg("添加关联商品失败!", false);
        }
Esempio n. 2
0
 private void btnDeleteAll_Click(object sender, System.EventArgs e)
 {
     if (StoreManagementHelper.RemoveReleatesProductByStore(this.StoreId))
     {
         base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
     }
 }
Esempio n. 3
0
 private void grdTopicProducts_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
 {
     if (StoreManagementHelper.RemoveReleatesProductByStore(this.StoreId, (int)this.grdTopicProducts.DataKeys[e.RowIndex].Value))
     {
         base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
     }
 }
Esempio n. 4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["StoreId"], out this.SotreId))
     {
         base.GotoResourceNotFound();
         return;
     }
     this.btnSave.Click += new System.EventHandler(this.btnEditShipper_Click);
     if (!this.Page.IsPostBack)
     {
         StoreManagementInfo store = StoreManagementHelper.GetStore(this.SotreId);
         if (store == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         Globals.EntityCoding(store, false);
         this.txtSupplierName.Text = store.StoreName;
         this.ddlReggion.SetSelectedRegionId(new int?(store.County));
         this.txtAddress.Text     = store.Address;
         this.txtPhone.Text       = store.Phone;
         this.txtMobile.Text      = store.Mobile;
         this.txtAddress.Text     = store.Address;
         this.txtDescription.Text = store.Description;
     }
 }
Esempio n. 5
0
        private void BindStoreProducts()
        {
            string ArrProduct = this.ProductId.Substring(0, this.ProductId.Length - 1);

            this.grdproducts.DataSource = StoreManagementHelper.PrintProducts(this.StoreId, ArrProduct);
            this.grdproducts.DataBind();
        }
        private void grdStore_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            ManagerHelper.CheckPrivilege(Privilege.StoreDelete);
            int supplierId = (int)this.grdStore.DataKeys[e.RowIndex].Value;

            if (StoreManagementHelper.DeleteStore(supplierId))
            {
                this.BindStore();
                this.ShowMsg("删除成功", true);
                return;
            }
            this.ShowMsg("删除失败", false);
        }
        protected void Page_Load(object sender, System.EventArgs e)

        {
            if (!this.Page.IsPostBack)
            {
                this.dropStores.DataBind();
                this.dropStores.DataSource     = StoreManagementHelper.GetStore();
                this.dropStores.DataTextField  = "StoreName";
                this.dropStores.DataValueField = "StoreId";
                this.dropStores.DataBind();
                this.dropStores.Items.Insert(0, new System.Web.UI.WebControls.ListItem("", ""));
            }
            this.btnDo.Click += new System.EventHandler(this.btnDo_Click);
        }
Esempio n. 8
0
 protected void btnFinish_Click(object sender, System.EventArgs e)
 {
     foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdTopicProducts.Rows)
     {
         int    displaysequence = 0;
         string QRcode          = string.Empty;
         System.Web.UI.WebControls.TextBox textBox = (System.Web.UI.WebControls.TextBox)gridViewRow.FindControl("txtSequence");
         if (int.TryParse(textBox.Text.Trim(), out displaysequence))
         {
             int relatedProductId = System.Convert.ToInt32(this.grdTopicProducts.DataKeys[gridViewRow.DataItemIndex].Value);
             StoreManagementHelper.UpdateRelateProductSequenceByStore(this.StoreId, relatedProductId, displaysequence);
         }
     }
     this.BindStoreProducts();
 }
        private void BindStore()
        {
            int           userStoreId  = ManagerHelper.GetStoreIdByUserId(HiContext.Current.User.UserId);
            DbQueryResult productTypes = StoreManagementHelper.GetStore(new StoreQuery
            {
                StoreName = this.searchkey,
                PageIndex = this.pager.PageIndex,
                PageSize  = this.pager.PageSize,
                StoreId   = userStoreId
            });

            this.grdStore.DataSource = productTypes.Data;
            this.grdStore.DataBind();
            this.pager.TotalRecords = productTypes.TotalRecords;
        }
Esempio n. 10
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["StoreId"], out this.StoreId))
     {
         base.GotoResourceNotFound();
         return;
     }
     this.hdtopic.Value                 = this.StoreId.ToString();
     this.btnDeleteAll.Click           += new System.EventHandler(this.btnDeleteAll_Click);
     this.grdTopicProducts.RowDeleting += new System.Web.UI.WebControls.GridViewDeleteEventHandler(this.grdTopicProducts_RowDeleting);
     if (!this.Page.IsPostBack)
     {
         StoreManagementInfo store = StoreManagementHelper.GetStore(this.StoreId);
         if (store == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         this.litPromotionName.Text = store.StoreName;
         this.BindStoreProducts();
     }
 }
Esempio n. 11
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            StoreManagementInfo StoreInfo = new StoreManagementInfo();

            StoreInfo.StoreName = this.txtSupplierName.Text.Trim();
            if (!this.ddlReggion.GetSelectedRegionId().HasValue)
            {
                this.ShowMsg("请选择地区", false);
                return;
            }
            StoreInfo.County      = this.ddlReggion.GetSelectedRegionId().Value;
            StoreInfo.Address     = this.txtAddress.Text.Trim();
            StoreInfo.Phone       = this.txtPhone.Text.Trim();
            StoreInfo.Mobile      = this.txtMobile.Text.Trim();
            StoreInfo.Description = this.txtDescription.Text.Trim();



            if (string.IsNullOrEmpty(StoreInfo.Phone) && string.IsNullOrEmpty(StoreInfo.Mobile))
            {
                this.ShowMsg("手机号码和电话号码必填其一", false);
                return;
            }
            int issucess = StoreManagementHelper.AddStore(StoreInfo);

            if (issucess > 0)
            {
                this.txtSupplierName.Text = "";
                this.txtAddress.Text      = "";
                this.txtPhone.Text        = "";
                this.txtMobile.Text       = "";
                this.txtDescription.Text  = "";

                this.ShowMsg("添加成功", true);
                base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/StoreManagement.aspx"), true);
                return;
            }
            this.ShowMsg("添加失败", false);
        }
Esempio n. 12
0
 private void BindStoreProducts()
 {
     this.grdTopicProducts.DataSource = StoreManagementHelper.GetRelatedStoreProducts(this.StoreId);
     this.grdTopicProducts.DataBind();
 }