public billviewer(Model.billitem billitem, int sn) { for (int i = 1; i <= 10; i++) { SubItems.Add(new ListViewSubItem()); } itemname = billitem.item_name; quantity = billitem.quantity; charge_amount = billitem.charge_amount; unit = billitem.unit; total_weight = billitem.weight * billitem.quantity; weight = billitem.weight; id = billitem.id; SubItems[0].Text = sn.ToString(); }
public void save(int bill_id, int date) { var bill_item = new Model.billitem() { charge_amount = charge_amount, quantity = quantity, unit = unit, bill_id = bill_id, weight = weight, date = date, created_at = DateTime.Now, updated_at = DateTime.Now, item_name = itemname }; DB.Instance.billitems.Add(bill_item); DB.Instance.SaveChanges(); }