示例#1
0
 private void LoadGoodsType()
 {
     Entities.GoodsType goodsType = RetrieveGoodsType();
     if (goodsType != null)
     {
         txtDescription.Text  = goodsType.Description;
         txtShortCode.Text    = goodsType.ShortCode;
         chkHazardous.Checked = goodsType.IsHazardous;
         chkDefault.Checked   = goodsType.IsDefault;
         btnAdd.Text          = "Update Goods Type";
     }
 }
示例#2
0
        void btnAdd_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Entities.GoodsType goodsType = PopulateGoodsType();

                if (_goodsTypeId > 0)
                {
                    Facade.GoodsType.Update(goodsType, ((Entities.CustomPrincipal)Page.User).UserName);
                }
                else
                {
                    Facade.GoodsType.Create(goodsType, ((Entities.CustomPrincipal)Page.User).UserName);
                }

                Response.Redirect("ListGoodsTypes.aspx");
            }
        }
示例#3
0
        private Entities.GoodsType PopulateGoodsType()
        {
            Entities.GoodsType goodsType;

            if (_goodsTypeId > 0)
            {
                goodsType = RetrieveGoodsType();
            }
            else
            {
                goodsType = new Entities.GoodsType();
            }

            goodsType.Description = txtDescription.Text;
            goodsType.ShortCode   = txtShortCode.Text;
            goodsType.IsDefault   = chkDefault.Checked;
            goodsType.IsHazardous = chkHazardous.Checked;
            return(goodsType);
        }
示例#4
0
 private Entities.GoodsType RetrieveGoodsType()
 {
     Entities.GoodsType goodsType = Facade.GoodsType.GetForGoodsTypeId(_goodsTypeId);
     return(goodsType);
 }