// // GET: /Business/ public ActionResult Index() { var Model = Services.GetAll(); // var payment = Model[0].Payments[0]; return(View(Model)); }
private void Form1_Load(object sender, EventArgs e) { try { customerBindingSource.DataSource = CustomerService.GetAll(); businessBindingSource.DataSource = BusinessService.GetAll(); orderBindingSource.DataSource = OrderService.GetAll(); clientBindingSource.DataSource = ClientService.GetAll(); Customer customer = customerBindingSource.Current as Customer; Business business = businessBindingSource.Current as Business; Order order = orderBindingSource.Current as Order; Client client = clientBindingSource.Current as Client; // Set delivery date to order date when delivery date is null order = _setDeliveryDate(order); clientOrderBindingSource.DataSource = ClientOrderService.GetClientOrders(customer.CustomerId, ClientType.Customer); clientOrderBindingSource1.DataSource = ClientOrderService.GetClientOrders(business.BusinessId, ClientType.Business); tcntrlLists.SelectedTab = tpageCustomers; tcntrlInfo.SelectedTab = tpageCustomer; // Set the combo box in orders to be populated with the ClientName string form the binding source cboOrderClient.DataSource = ClientService.GetAll().Select(x => x.ClientName).ToList(); // Set the combo box index the proper client name _setOrderComboBoxIndex(order); // Setup initial states of pages tpageCustomer.Enabled = false; tpageBusiness.Enabled = false; tpageOrder.Enabled = false; gridCustomerOrders.Enabled = true; gridBusinessOrders.Enabled = true; } catch (Exception ex) { MetroFramework.MetroMessageBox.Show(this, ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); MetroFramework.MetroMessageBox.Show(this, ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }