コード例 #1
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (Validate() == false)
            {
                return;
            }

            if (ProductBLL.GetDuplicateName(txtboxName.Text, this._products.Id) != null)
            {
                MessageBox.Show("Username is already used");
            }
            else
            {
                walangforeverRestaurant.Domain.Model.Products products = new walangforeverRestaurant.Domain.Model.Products();
                products.Id   = Guid.NewGuid();
                products.Name = txtboxName.Text;

                decimal dec = 0;
                decimal.TryParse(txtboxPrice.Text, out dec);
                products.Price = dec;

                products.Id = this._products.Id;
                ProductBLL.Update(products);
                MessageBox.Show("User successfully Updated.");
                this._sender.showList();
                this.Close();
            }
        }
コード例 #2
0
 public Update(walangforeverRestaurant.Domain.Model.Products products, Products.List sender)
 {
     InitializeComponent();
     this.txtboxName.Text = products.Name;
     this._products       = products;
     this._sender         = sender;
 }