示例#1
0
        public void incrementByOne(String billRowId, String price)
        {
            billItemRow = billItemList.Find(x => x.billrowID == billRowId);//getting the bill row from the list
            //modifying the bill row
            double unitprice = Double.Parse(billItemRow.purchasePrice);
            double total;

            bool res = Double.TryParse(billItemRow.total, out total);

            if (res == false)
            {
                MessageBox.Show("Cannot increment");
            }
            else
            {
                total = total + unitprice;
                //assign it to text field again
                billItemRow.total = total.ToString();
            }
            int qty = Int32.Parse(billItemRow.Quantity);

            qty = qty + 1;
            billItemRow.Quantity = qty.ToString();
            //adding again to the list
            billItemList.Add(billItemRow);
            setStockoutAmount();
            loadBilllist(); //load the bill list again
        }
示例#2
0
 //method to stock out rowa
 public void addToStockOutList(String id, String name, String price, String measureUnit)
 {
     billItemRow                 = new BillItemRow();
     billItemRow.billrowID       = id;
     billItemRow.ItemName        = name;
     billItemRow.measurementUnit = measureUnit;
     billItemRow.Quantity        = 1.ToString();; //this should be changed
     billItemRow.total           = price;
     billItemRow.purchasePrice   = price;         //price of a one food ite
     billItemList.Add(billItemRow);
     loadBilllist();
 }