Beispiel #1
0
        public void BindUserShop()
        {
            Chain.BLL.SysShop bllSysShop = new Chain.BLL.SysShop();
            DataTable         dtSysShop  = new DataTable();

            if (this._UserShopID == 1)
            {
                dtSysShop = bllSysShop.GetList(" ShopType=3 ").Tables[0];
            }
            else
            {
                dtSysShop = bllSysShop.GetList(string.Format("  ShopType=3 and FatherShopID = {0} OR ShopID = {1}", this._UserShopID, this._UserShopID)).Tables[0];
            }
            this.sltShop.Items.Add(new ListItem("====请选择====", ""));
            foreach (DataRow dr in dtSysShop.Rows)
            {
                this.sltShop.Items.Add(new ListItem(dr["ShopName"].ToString(), dr["ShopID"].ToString()));
            }
        }
Beispiel #2
0
        public void bindSltList()
        {
            this.hdShopID.Value = this._UserShopID.ToString();
            Chain.BLL.SysShop bllSysShop = new Chain.BLL.SysShop();
            string            strWhere   = "ShopType=1 ";
            DataTable         dtSysShop  = bllSysShop.GetList(strWhere).Tables[0];

            foreach (DataRow dr in dtSysShop.Rows)
            {
                this.sltShopList.Items.Add(new ListItem(dr["ShopName"].ToString(), dr["ShopID"].ToString()));
            }
            if (this._UserShopID > 1)
            {
                this.sltShopList.Value = this._UserShopID.ToString();
                this.sltShopList.Attributes.Add("disabled", "disabled");
            }
        }
Beispiel #3
0
        private void bindSyncShopList()
        {
            Chain.BLL.SysShop bllSS  = new Chain.BLL.SysShop();
            string            sqlStr = "ShopID>0 and ShopID<>" + this._UserShopID;

            sqlStr = PubFunction.GetShopAuthority(this._UserShopID, "ShopID", sqlStr);
            DataTable dt = bllSS.GetList(sqlStr).Tables[0];

            if (dt.Rows.Count > 0)
            {
                this.rptSyncShopList.DataSource = dt;
                this.rptSyncShopList.DataBind();
            }
            else
            {
                this.lblShowSync.Visible        = false;
                this.lblShowSyncPartial.Visible = false;
            }
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         PubFunction.BindSysAreaNew(this.sltProvince, 0);
         Chain.BLL.SysShop bllShop = new Chain.BLL.SysShop();
         DataTable         dt      = bllShop.GetList("ShopID>0").Tables[0];
         string            strSql  = "ShopID>0 and ShopType=3  ";
         if (base.Request.QueryString["key"] != null)
         {
             string key = base.Request.QueryString["key"].ToString();
             if (key != "")
             {
                 strSql            = strSql + " and ShopName like'%" + key + "%'";
                 this.txtKey.Value = key;
             }
         }
         if (base.Request.QueryString["pid"] != null)
         {
             if (base.Request.QueryString["pid"] != "")
             {
                 strSql = strSql + " and ShopProvince=" + base.Request.QueryString["pid"];
                 PubFunction.BindSysAreaNew(this.sltCity, int.Parse(base.Request.QueryString["pid"]));
             }
             this.txtPID.Value      = base.Request.QueryString["pid"];
             this.sltProvince.Value = base.Request.QueryString["pid"];
         }
         if (base.Request.QueryString["cid"] != null)
         {
             if (base.Request.QueryString["cid"] != "")
             {
                 strSql = strSql + " and ShopCity=" + base.Request.QueryString["cid"];
                 PubFunction.BindSysAreaNew(this.sltCounty, int.Parse(base.Request.QueryString["cid"]));
             }
             this.txtCID.Value  = base.Request.QueryString["cid"];
             this.sltCity.Value = base.Request.QueryString["cid"];
         }
         if (base.Request.QueryString["cyid"] != null)
         {
             if (base.Request.QueryString["cyid"] != "")
             {
                 strSql = strSql + " and ShopCounty=" + base.Request.QueryString["cyid"];
             }
             this.txtCYID.Value   = base.Request.QueryString["cyid"];
             this.sltCounty.Value = base.Request.QueryString["cyid"];
         }
         if (base.Request.QueryString["type"] == "all")
         {
             dt = bllShop.GetList(strSql).Tables[0];
         }
         else
         {
             dt = bllShop.GetList(10, strSql, "ShopCreateTime").Tables[0];
         }
         this.rptShop.DataSource = dt;
         this.rptShop.DataBind();
         if (dt.Rows.Count < 10 || base.Request.QueryString["type"] == "all")
         {
             this.moreShop.Attributes.Add("style", "display:none");
         }
     }
 }
Beispiel #5
0
 private void rptShopBind(string sql)
 {
     Chain.BLL.SysShop bllShop = new Chain.BLL.SysShop();
     this.rptShop.DataSource = bllShop.GetList(sql).Tables[0];
     this.rptShop.DataBind();
 }
Beispiel #6
0
        protected void btnCopy_Click(object sender, EventArgs e)
        {
            Chain.BLL.SysShop             bllShop = new Chain.BLL.SysShop();
            Chain.BLL.GoodsClassAuthority bllGoodsClassAuthority = new Chain.BLL.GoodsClassAuthority();
            Chain.BLL.GoodsClass          bllGoodsClass          = new Chain.BLL.GoodsClass();
            DataTable dtShop       = bllShop.GetList("ShopID>0 and ShopType=3 and IsMain=0 ").Tables[0];
            DataTable dtGoodsClass = bllGoodsClass.GetList("CreateShopID=" + this._UserShopID).Tables[0];

            for (int i = 0; i < dtShop.Rows.Count; i++)
            {
                int ShopID = int.Parse(dtShop.Rows[i]["ShopID"].ToString());
                for (int j = 0; j < dtGoodsClass.Rows.Count; j++)
                {
                    int ClassID = int.Parse(dtGoodsClass.Rows[j]["ClassID"].ToString());
                    Chain.Model.GoodsClassAuthority modelGoodsClassAuthority = new Chain.Model.GoodsClassAuthority();
                    modelGoodsClassAuthority.ClassID = ClassID;
                    modelGoodsClassAuthority.ShopID  = ShopID;
                    int count = bllGoodsClassAuthority.GetRecordCount(string.Concat(new object[]
                    {
                        "ShopID=",
                        ShopID,
                        " and ClassID=",
                        ClassID
                    }));
                    if (count == 0)
                    {
                        bllGoodsClassAuthority.Add(modelGoodsClassAuthority);
                    }
                }
            }
            Chain.BLL.GoodsClassDiscount bllGoodsClassDiscount = new Chain.BLL.GoodsClassDiscount();
            DataTable dtClassDiscount = bllGoodsClassDiscount.GetList("DiscountShopID=" + this._UserShopID).Tables[0];

            for (int i = 0; i < dtShop.Rows.Count; i++)
            {
                int ShopID = int.Parse(dtShop.Rows[i]["ShopID"].ToString());
                for (int j = 0; j < dtClassDiscount.Rows.Count; j++)
                {
                    Chain.Model.GoodsClassDiscount modelGoodsClassDiscount = new Chain.Model.GoodsClassDiscount();
                    int ClassID    = int.Parse(dtClassDiscount.Rows[j]["GoodsClassID"].ToString());
                    int MemLevelID = int.Parse(dtClassDiscount.Rows[j]["MemLevelID"].ToString());
                    modelGoodsClassDiscount.GoodsClassID         = ClassID;
                    modelGoodsClassDiscount.MemLevelID           = MemLevelID;
                    modelGoodsClassDiscount.DiscountShopID       = ShopID;
                    modelGoodsClassDiscount.ClassDiscountPercent = int.Parse(dtClassDiscount.Rows[j]["ClassDiscountPercent"].ToString());
                    modelGoodsClassDiscount.ClassPointPercent    = int.Parse(dtClassDiscount.Rows[j]["ClassPointPercent"].ToString());
                    DataTable dtShopGoodsClassDiscount = bllGoodsClassDiscount.GetList(string.Concat(new object[]
                    {
                        "MemLevelID=",
                        MemLevelID,
                        " and DiscountShopID=",
                        ShopID,
                        " and GoodsClassID=",
                        ClassID
                    })).Tables[0];
                    if (dtShopGoodsClassDiscount.Rows.Count == 0)
                    {
                        bllGoodsClassDiscount.Add(modelGoodsClassDiscount);
                    }
                    else
                    {
                        modelGoodsClassDiscount.ClassDiscountID = int.Parse(dtShopGoodsClassDiscount.Rows[0]["ClassDiscountID"].ToString());
                        bllGoodsClassDiscount.Update(modelGoodsClassDiscount);
                    }
                }
            }
            Chain.BLL.Goods bllGoods = new Chain.BLL.Goods();
            DataTable       dtGoods  = bllGoods.GetGoodsList("CreateShopID=" + this._UserShopID).Tables[0];

            Chain.BLL.GoodsNumber bllGoodsNumber = new Chain.BLL.GoodsNumber();
            for (int i = 0; i < dtShop.Rows.Count; i++)
            {
                int ShopID = int.Parse(dtShop.Rows[i]["ShopID"].ToString());
                for (int j = 0; j < dtGoods.Rows.Count; j++)
                {
                    int GoodsID = int.Parse(dtGoods.Rows[j]["GoodsID"].ToString());
                    int count   = bllGoodsNumber.GetRecordCount(string.Concat(new object[]
                    {
                        "GoodsID=",
                        GoodsID,
                        " and ShopID=",
                        ShopID
                    }));
                    Chain.Model.GoodsNumber modelGoodsNumber = new Chain.Model.GoodsNumber();
                    modelGoodsNumber.GoodsID = GoodsID;
                    modelGoodsNumber.Number  = 0m;
                    modelGoodsNumber.ShopID  = ShopID;
                    if (count == 0)
                    {
                        bllGoodsNumber.Add(modelGoodsNumber);
                    }
                }
            }
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "message", "<Script Language='JavaScript' defer>art.dialog({title: '系统提示',time: 2,content:'同步成功',close: function () { location.href = 'GoodsList.aspx?PID=62';  }});</script>");
        }