Exemple #1
0
 public AddInvoice(UiController.UIController uiController, Invoice invoice, bool update = false)
 {
     InitializeComponent();
     _uiController = uiController;
     _update       = update;
     _uiController.GetAllAutos(cmbAuto);
     _uiController.GetAllEmployees(cmbEmployee);
     txtValue.Text = "0";
     _invoice      = invoice;
     if (_invoice != null)
     {
         if (_invoice.InvoiceItems.Any())
         {
             btnSubmitInvoice.Visible = true;
             txtValue.Text            = _invoice.InvoiceItems.Sum(s => s.Value).ToString();
         }
         _invoiceItems            = invoice.InvoiceItems;
         cmbAuto.SelectedItem     = invoice.Auto;
         cmbEmployee.SelectedItem = invoice.Employee;
     }
     else
     {
         btnSubmitInvoice.Visible = false;
     }
 }
 public SearchInvoices(UiController.UIController uiController)
 {
     InitializeComponent();
     _uiController = uiController;
     _uiController.GetAllAutos(cmbCriteria);
 }