Exemplo n.º 1
0
        private void Add()
        {
            var model = new localhost.ProductModel();

            FillClass(model);
            ProductWS.Add(model);
        }
Exemplo n.º 2
0
 private void FillClass(localhost.ProductModel model)
 {
     model.ItemCode = txtItemCode.Text;
     model.ItemName = txtItemName.Text;
     model.Quantity = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToInt32(txtQuantity.Text);
     model.Price    = string.IsNullOrEmpty(txtPrice.Text) ? 0 : Convert.ToDecimal(txtPrice.Text);
     model.Total    = string.IsNullOrEmpty(txtTotal.Text) ? 0 : Convert.ToDecimal(txtTotal.Text);
 }