public void Getinfo() { List <string> bills = Sqlader.getColumn("Brutto"); List <float> fbills = new List <float>(); float x; foreach (string item in bills) { if (float.TryParse(item, out _)) { fbills.Add(float.Parse(item)); } ; } List <string> netto = Sqlader.getColumn("Netto"); List <float> fnetto = new List <float>(); foreach (string item in netto) { if (float.TryParse(item, out _)) { fnetto.Add(float.Parse(item)); } ; } label2.Text = bills.Count.ToString(); label6.Text = (fbills.Sum() / fbills.Count).ToString(); label8.Text = (fbills.Sum() - fnetto.Sum()).ToString(); }
public void Createallbill() { ////////////////// ///Get data from database by query getBillmodel ////////////////// /* * paneldateparrent.Controls.Clear(); * List<getBiilmodel> x = Sqlader.getQuery(); * foreach (getBiilmodel item in x) * { * CreateOnebill(item.Dokument, item.Brutto.ToString().Insert(item.Brutto.ToString().Length-2,","), item.Data_wystawienia); * } */ paneldateparrent.Controls.Clear(); List <string> name = Sqlader.getColumn("Dokument"); List <string> price = Sqlader.getColumn("Brutto"); List <string> dateW = Sqlader.getColumn("Data_wystawienia"); List <string> dateS = Sqlader.getColumn("Data_sprzedazy"); List <string> netto = Sqlader.getColumn("Netto"); List <string> nip = Sqlader.getColumn("NIP"); List <string> vat = Sqlader.getColumn("Vat"); List <string> addres = Sqlader.getColumn("Adres"); List <string> country = Sqlader.getColumn("Kraj"); List <string> paymethond = Sqlader.getColumn("Sposob_platnosci"); List <string> postcode = Sqlader.getColumn("Kod_pocztowy"); List <string> fname = Sqlader.getColumn("Imie"); List <string> lname = Sqlader.getColumn("Nazwisko"); List <string> city = Sqlader.getColumn("Miasto"); for (int i = 0; i < name.Count; i++) { CreateOnebilltest(name[i], price[i], dateW[i], dateS[i], netto[i], fname[i], lname[i], nip[i], addres[i], postcode[i], city[i], vat[i], country[i], paymethond[i]); } }