public ReportViewInvoice(int id) { InitializeComponent(); DataAccess da = new DataAccess(); InvoiceId = id; Outgo = da.InvoiceGet(id); }
public SpareOutgoEditView(invoice _inv) { da = new DataAccess(); InitializeComponent(); edtNumber.Text = da.SpareOutgoGetMaxId().ToString(); Invoice = da.InvoiceGet(_inv.id); }
private void LoadInvoices() { da = new DataAccess(); List<invoice> list = da.InvoiceGet(); foreach (invoice s in list) { if (s.InvoiceDate != null) { string strDate = ""; strDate += s.InvoiceDate.Value.Year + "."; if (s.InvoiceDate.Value.Month < 10) strDate += "0"; strDate += s.InvoiceDate.Value.Month + "."; if (s.InvoiceDate.Value.Day < 10) strDate += "0"; strDate += s.InvoiceDate.Value.Day; s.DateString = strDate; } } dgInvoices.DataContext = list.OrderByDescending(s => s.InvoiceDate); }