示例#1
0
        protected void GetGoodsInfo(int goodsID)
        {
            Chain.BLL.Goods   bllGoods   = new Chain.BLL.Goods();
            Chain.Model.Goods modelGoods = bllGoods.GetModel(goodsID);
            DataTable         dtGoods    = bllGoods.GetItemAll(goodsID).Tables[0];

            this.txtGoodsID.Value   = modelGoods.GoodsID.ToString();
            this.txtGoodsCode.Value = modelGoods.GoodsCode;
            this.txtCode.Value      = modelGoods.GoodsCode;
            if (modelGoods.GoodsType == 1)
            {
                this.chkService.Checked = true;
            }
            this.txtGoodsName.Value     = modelGoods.Name;
            this.txtGoodsNameCode.Value = modelGoods.NameCode;
            PubFunction.BindGoodsClass(this.sltGoodsClass, modelGoods.CreateShopID);
            this.sltGoodsClass.Value       = modelGoods.GoodsClassID.ToString();
            this.sltjldw.Value             = modelGoods.Unit;
            this.sltCommissionType.Value   = modelGoods.CommissionType.ToString();
            this.txtCommissionNumber.Value = modelGoods.CommissionNumber.ToString();
            this.txtGoodsPrice.Value       = Math.Round(modelGoods.Price, 2).ToString();
            if (modelGoods.Point != -1)
            {
                this.txtGoodsPoint.Value = modelGoods.Point.ToString();
            }
            else
            {
                this.txtGoodsPoint.Value = "";
            }
            this.txtGoodsBidPrice.Value    = Math.Round(modelGoods.GoodsBidPrice, 2).ToString();
            this.txtGoodsMinPercent.Value  = modelGoods.MinPercent.ToString();
            this.txtGoodsRemark.Value      = modelGoods.GoodsRemark;
            this.txtGoodsSalePercent.Value = modelGoods.SalePercet.ToString();
            PubFunction.BindEditCustomFields(this.tbCustomField, "goods", dtGoods.Rows[0]);
            PubFunction.BindShopSelect(this._UserShopID, this.sltShopList, modelGoods.CreateShopID, this._UserShopID != 1);
            this.txtShopID.Value = modelGoods.CreateShopID.ToString();
            this.txtShopID.Value = modelGoods.CreateShopID.ToString();
        }
示例#2
0
        protected void GetMemToEdit(int memID)
        {
            Chain.Model.Mem modelMem = new Chain.Model.Mem();
            Chain.BLL.Mem   bllMem   = new Chain.BLL.Mem();
            modelMem = bllMem.GetModel(memID);
            DataTable dtMem = bllMem.GetItemAll(memID).Tables[0];

            this.txtMemID.Value   = modelMem.MemID.ToString();
            this.txtMemCard.Value = modelMem.MemCard;
            this.txtMemCard.Attributes.Add("readonly", "true");
            this.txtMemName.Value    = modelMem.MemName;
            this.txtCardNumber.Value = modelMem.MemCardNumber;
            if (modelMem.MemSex)
            {
                this.sltMemSex.SelectedIndex = 0;
            }
            else
            {
                this.sltMemSex.SelectedIndex = 1;
            }
            this.txtMemIdentityCard.Value = modelMem.MemIdentityCard;
            string strMemBirthday = modelMem.MemBirthday.ToString();

            if (strMemBirthday.IndexOf("1900") == -1 && strMemBirthday.IndexOf("0001") == -1)
            {
                this.txtMemBirthday.Value = modelMem.MemBirthday.ToShortDateString();
            }
            else
            {
                this.txtMemBirthday.Value = "";
            }
            if (modelMem.MemPoint.ToString() != "")
            {
                this.txtMemPoint.Value = modelMem.MemPoint.ToString();
            }
            else
            {
                this.txtMemPoint.Value = "0";
            }
            this.sltShop.Items.Add(new ListItem(new Chain.BLL.SysShop().GetModel(modelMem.MemShopID).ShopName, modelMem.MemShopID.ToString()));
            if (modelMem.MemMoney.ToString() != "")
            {
                this.txtMemMoney.Value = Math.Round(modelMem.MemMoney, 2).ToString();
            }
            else
            {
                this.txtMemMoney.Value = "0";
            }
            this.txtMemMobile.Value  = modelMem.MemMobile;
            this.txtMemEmail.Value   = modelMem.MemEmail;
            this.txtMemAddress.Value = modelMem.MemAddress;
            this.sltMemState.Value   = modelMem.MemState.ToString();
            this.sltMemLevelID.Value = modelMem.MemLevelID.ToString();
            this.sltShop.Value       = modelMem.MemShopID.ToString();
            this.sltShop.Attributes.Add("disabled", "disabled");
            this.txtMemRecommendID.Value = modelMem.MemRecommendID.ToString();
            if (modelMem.MemRecommendID != 0)
            {
                Chain.Model.Mem modelRecommendMem = new Chain.Model.Mem();
                modelRecommendMem = bllMem.GetModel(modelMem.MemRecommendID);
                this.txtMemRecommendCard.Value = modelRecommendMem.MemCard;
            }
            this.txtMemCreateTime.Value = modelMem.MemCreateTime.ToShortDateString();
            string strMemPastTime = modelMem.MemPastTime.ToString();

            if (strMemPastTime.IndexOf("2900") == -1 && strMemPastTime.IndexOf("0001") == -1)
            {
                this.txtMemPastTime.Value = modelMem.MemPastTime.ToShortDateString();
                this.chkMemIsPast.Checked = false;
            }
            else
            {
                this.txtMemPastTime.Value = "";
                this.chkMemIsPast.Checked = true;
            }
            if (modelMem.MemPhoto != "")
            {
                this.imgMemPhoto.Src   = base.GetWebRoot() + modelMem.MemPhoto;
                this.txtMemPhoto.Value = modelMem.MemPhoto;
            }
            else
            {
                this.imgMemPhoto.Src   = "../images/member/nophoto.gif";
                this.txtMemPhoto.Value = "";
            }
            this.txtMemRemark.Value = StringPlus.HtmlDecode(modelMem.MemRemark);
            this.sltMemUserID.Value = modelMem.MemUserID.ToString();
            this.txtTelephone.Value = modelMem.MemTelePhone;
            if (modelMem.MemQRCode != "")
            {
                this.trTitle.Visible  = true;
                this.trQrCode.Visible = true;
                this.imgQRCode.Src    = modelMem.MemQRCode;
            }
            else
            {
                this.trTitle.Visible  = false;
                this.trQrCode.Visible = false;
            }
            if (modelMem.MemProvince != "")
            {
                this.ucSysArea.sltProvince.Items.Clear();
                PubFunction.BindSysArea(this.ucSysArea.sltProvince, 0);
                this.ucSysArea.sltProvince.Value = modelMem.MemProvince;
            }
            if (modelMem.MemCity != "" && modelMem.MemCity != null && modelMem.MemProvince != "" && modelMem.MemProvince != null)
            {
                this.ucSysArea.sltCity.Items.Clear();
                PubFunction.BindSysArea(this.ucSysArea.sltCity, int.Parse(modelMem.MemProvince));
                this.ucSysArea.sltCity.Value = modelMem.MemCity;
            }
            if (modelMem.MemCounty != "" && modelMem.MemCounty != null && modelMem.MemCity != "" && modelMem.MemCity != null)
            {
                this.ucSysArea.sltCounty.Items.Clear();
                PubFunction.BindSysArea(this.ucSysArea.sltCounty, int.Parse(modelMem.MemCity));
                this.ucSysArea.sltCounty.Value = modelMem.MemCounty;
            }
            if (modelMem.MemVillage != "" && modelMem.MemVillage != null && modelMem.MemCounty != "" && modelMem.MemCounty != null)
            {
                this.ucSysArea.sltVillage.Items.Clear();
                PubFunction.BindSysArea(this.ucSysArea.sltVillage, int.Parse(modelMem.MemCounty));
                this.ucSysArea.sltVillage.Value = modelMem.MemVillage;
            }
            PubFunction.BindEditCustomFields(this.tbCustomField, "Mem", dtMem.Rows[0]);
        }