Пример #1
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            int result;

            if (brandid > 0)
            {
                // we are in edit mode
                result = brand.Update(brandid, Auth.Instance().ShopId, CBOCategory.SelectedValue.ToString(),
                                      TxtLiquor.Text, NBBox.Value, NBWeight.Value,
                                      NBPurchaseRate.Value, NBSaleRate.Value, NBBranchCommission.Value, TxtReserve.Text);
            }
            else
            {
                result = brand.Add(Auth.Instance().ShopId, CBOCategory.SelectedValue.ToString(),
                                   TxtLiquor.Text,
                                   NBBox.Value, NBWeight.Value,
                                   NBPurchaseRate.Value, NBSaleRate.Value, NBBranchCommission.Value, TxtReserve.Text);
            }

            if (result > 0)
            {
                MessageBox.Show(@"Record Saved");
            }

            BtnAdd.Enabled     = true;
            BtnEdit.Enabled    = true;
            BtnDelete.Enabled  = true;
            BtnSave.Enabled    = false;
            BtnCancel.Enabled  = false;
            GBControls.Enabled = false;
            FillGrid();
        }
Пример #2
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         BrandInfo brandInfo = new BrandInfo();
         if (base.IsEdit)
         {
             brandInfo = Brand.GetDataById(base.OpID);
         }
         brandInfo.BrandName     = WebUtils.GetString(this.TextBox1.Text);
         brandInfo.CompanyName   = string.Empty;
         brandInfo.OfficialSite  = WebUtils.GetString(this.TextBox3.Text);
         brandInfo.IndName       = WebUtils.GetString(this.DropDownList4.SelectedValue);
         brandInfo.BrandDesc     = WebUtils.GetString(this.TextBox5.Text);
         brandInfo.Sort          = Brand.MaxSort + 1;
         brandInfo.IsRecommend   = false;
         brandInfo.AutoTimeStamp = System.DateTime.Now;
         if (string.IsNullOrEmpty(brandInfo.BrandName))
         {
             base.ShowMsg("品牌名称不为空!");
         }
         else
         {
             if (base.Action.Equals(ActionType.Add.ToString()))
             {
                 if (Brand.Add(brandInfo) > 0)
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "添加品牌[" + brandInfo.BrandDesc + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("添加品牌失败");
                 }
             }
             if (base.Action.Equals(ActionType.Modify.ToString()))
             {
                 if (Brand.Update(brandInfo))
                 {
                     PageBase.log.AddEvent(base.LoginAccount.AccountName, "修改品牌[" + brandInfo.BrandName + "] thành công");
                     MessageUtils.DialogCloseAndParentReload(this);
                 }
                 else
                 {
                     base.ShowMsg("修改品牌失败");
                 }
             }
         }
     }
 }
        public void Guardar()
        {
            Brand nuevaMarca = new Brand();

            nuevaMarca.Id      = _marcaCodigo;
            nuevaMarca.Name    = NombreMarca;
            nuevaMarca.Country = PaisSeleccionado;
            nuevaMarca.Add();
            Reiniciar();
        }
        private IComponent CreateGucciBrand()
        {
            IComponent vivineBest = new Brand<GucciBrand>();

            IComponent WomensAccessory = vivineBest.Add(new ProductCategory("WomensAccessory"));

            IComponent Bages = WomensAccessory.Add(new ProductCategory("Bags"));
            Bages.Add(new Product("GG running large tote with double G", "$3400"));
            Bages.Add(new Product("Jackie Shoulder Bag", "$1890"));

            IComponent Shoes = WomensAccessory.Add(new ProductCategory("Shoes"));
            Shoes.Add(new Product("ophelie flat thong tiger head", "$1750"));
            Shoes.Add(new Product("women's horsebit moccasin", "$585"));

            IComponent Womenswear = vivineBest.Add(new ProductCategory("Womenswear"));

            IComponent Dresses = Womenswear.Add(new ProductCategory("Dresses"));
            Dresses.Add(new Product("bi-color overlap dress", "$1900"));

            IComponent Coats = Womenswear.Add(new ProductCategory("Coats"));
            Coats.Add(new Product("Jacket with leather collar", "$2100"));

            return vivineBest;
        }
        private IComponent CreateVivinneBrand()
        {
            IComponent vivineBest = new Brand<VivienneBrand>();

            IComponent WomensAccessory = vivineBest.Add(new ProductCategory("WomensAccessory"));

            IComponent Bages = WomensAccessory.Add(new ProductCategory("Bags"));
            Bages.Add(new Product("DERBY BAG NEW EXHIBITION 5571", "$655"));
            Bages.Add(new Product("DOLCE VITA BAG 5301", "$910"));

            IComponent Shoes = WomensAccessory.Add(new ProductCategory("Shoes"));
            Shoes.Add(new Product("PINK WANTING BALLERINAS", "$115"));
            Shoes.Add(new Product("BLACK BUTTON SANDAL", "$108"));

            IComponent Womenswear = vivineBest.Add(new ProductCategory("Womenswear"));

            IComponent Dresses = Womenswear.Add(new ProductCategory("Dresses"));
            Dresses.Add(new Product("AVA CHANGEANT TAFFETA DRESS", "$855"));

            IComponent Coats = Womenswear.Add(new ProductCategory("Coats"));
            Coats.Add(new Product("WATERPROOF MA", "$980"));

            return vivineBest;
        }
Пример #6
0
 public void AddBrand(Brand B)
 {
     Brand.Add(B);
 }