示例#1
0
    protected void Bind()
    {
        ImageBind();
        WMGoods good = WMGoods.Get(Id);

        if (good != null)
        {
            CategoryMasterBind(good.Categories);
            BrandBind(good.BrandId);
            StateBind(good.StatusId);

            GoodName.Text      = good.Name;
            OriginalPrice.Text = good.OriginalPrice.ToString();
            PresentPrice.Text  = good.PresentPrice.ToString();
            GoodUnit.Text      = good.Unit;
            GoodInte.Text      = good.Integral.ToString();
            GoodBonus.Text     = good.Bonus.ToString();
            GoodGoldPool.Text  = good.GoldPool.ToString();
            AddDate.Text       = good.AddDate.ToString("yyyy-MM-dd HH:mm");
            GoodDsec.Text      = good.Desc;
            GoodSpec.Text      = good.Spec;
            GoodService.Text   = good.Service;
            GoodClick.Text     = good.Clicks.ToString();
            GoodSave.Text      = good.Saves.ToString();
        }
    }
示例#2
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        bool flag = false;

        if (this.IsValid)
        {
            string cid = CategoryId.Value;
            if (General.IsNullable(cid))
            {
                CategoryValid.CssClass = CategoryValid.CssClass.Replace(" hide", "");
                return;
            }

            WMGoods good = WMGoods.Get(Id);

            if (good != null)
            {
                good.Name          = GoodName.Text;
                good.CategoryId    = cid;
                good.BrandId       = BrandList.SelectedValue;
                good.OriginalPrice = OriginalPrice.Text.ToDouble().Value;
                good.PresentPrice  = PresentPrice.Text.ToDouble();
                good.Unit          = GoodUnit.Text;
                good.Integral      = GoodInte.Text.ToInt32();
                good.Bonus         = GoodBonus.Text.ToInt32();
                good.GoldPool      = GoodGoldPool.Text.ToInt32();
                good.Desc          = GoodDsec.Text;
                good.Spec          = GoodSpec.Text;
                good.Service       = GoodService.Text;
                good.StatusId      = StateList.SelectedValue.ToInt32();

                flag = good.Update();
            }
        }

        if (flag)
        {
            Bind();
        }

        Helper.MessageBox(flag);
    }