public SellDialog() { InitializeComponent(); data.Columns.Add("id", "Id"); data.Columns.Add("cant", "Cant"); data.Columns.Add("producto", "Producto"); data.Columns.Add("unidad", "Unidad"); data.Columns.Add("pu", "Precio Unitario"); data.Columns.Add("total", "Total"); data.Columns[0].Width = 50; data.Columns[1].Width = 50; data.Columns[2].Width = 200; data.Columns[3].Width = 100; data.Columns[4].Width = 100; data.Columns[5].Width = 100; lp = PersonObj.getAllByKindId(1); foreach (PersonObj p in lp) { client_.Items.Add(p.name + " " + p.lastname); } List <SellObj> sell = SellObj.sell; float total = 0; for (int i = 0; i < sell.Count; i++) { ProductObj product = ProductObj.getById(sell[i].product_id); data.Rows.Add(product.id, sell[i].q, product.name, product.unit, product.price_out, sell[i].q * product.price_out); total += sell[i].q * product.price_out; } data.Rows.Add("", "", "Total", "", "", total); }
public void load_persons() { dataGridView1.Rows.Clear(); List <PersonObj> list = PersonObj.getAllByKindId(kind); for (int i = 0; i < list.Count; i++) { //MessageBox.Show(input + " - " + output); dataGridView1.Rows.Add(list[i].id, list[i].name, list[i].lastname, list[i].address, list[i].email, list[i].phone); } }
public Re() { InitializeComponent(); prods = ProductObj.getAll(); provs = PersonObj.getAllByKindId(2); foreach (ProductObj p in prods) { product.Items.Add(p.name); } foreach (PersonObj p in provs) { provider.Items.Add(p.name + " " + p.lastname); } data.Columns.Add("id", "Id"); data.Columns.Add("unidad", "Unidad"); data.Columns.Add("nombre", "Nombre"); data.Columns.Add("cantidad", "Cantidad"); data.Columns.Add("precio", "Precio"); data.Columns[0].Width = 50; data.Columns[1].Width = 100; data.Columns[2].Width = 350; data.Columns[3].Width = 100; data.Columns[4].Width = 100; }