public BLResponse<Sale> GetSales(GetSales request, BLRequest blRequest){ var sales = GetSalesFromRepo(request, blRequest); var r = new BLResponse<Sale>(); if( !IsCayita(blRequest)) { r.Result= sales; } else { r.Html = BuildSalesGrid(sales).ToString(); } return r; }
public void AddSalesToDB() { Login getFirstname = (Login)Application.OpenForms["Login"]; //GetNames log = new GetNames(); //string sname = log.Surname(); //string fname = log.Firstname(); int Unitprice, Quantity; string discount, totalamount; string prodname; string staffname = getFirstname.username; DateTime Date = DateTime.Now; foreach (ListViewItem Item in listViewPurchase.Items) { prodname = Item.SubItems[0].Text; Quantity = Convert.ToInt32(Item.SubItems[1].Text); Unitprice = Convert.ToInt32(Item.SubItems[2].Text); //double conv = Convert.ToDouble(Item.SubItems[3].Text); discount = Item.SubItems[3].Text; totalamount = Item.SubItems[4].Text; GetSales sales = new GetSales(staffname, Date, prodname, Quantity, Unitprice, discount, totalamount); } }