コード例 #1
0
        /// <summary>
        /// A simple function that takes a string and does a ToUpper
        /// </summary>
        /// <param name="input"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public string FunctionHandler(SNSEvent evnt, ILambdaContext context)
        {
            var order = new ClientOrderService(context.Logger);

            foreach (var item in evnt?.Records)
            {
                context.Logger.Log($"details {item.Sns.Timestamp}");
                context.Logger.Log($"sns content {item.Sns.Message}");

                var result = order.CreateOrder(item.Sns.Message);
                Console.WriteLine($"Status of order v2 : {result.Status}");

                Console.WriteLine(item.Sns.Message);
            }
            return(string.Empty);
        }
コード例 #2
0
        // Grid Clicks
        private void gridCustomers_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                Customer customer = customerBindingSource.Current as Customer;
                tcntrlInfo.SelectedTab = tpageCustomer;

                clientOrderBindingSource.DataSource = ClientOrderService.GetClientOrders(customer.CustomerId, ClientType.Customer);
                tpageCustomer.Enabled      = false;
                gridCustomerOrders.Enabled = true;
            }
            catch (Exception ex)
            {
                MetroFramework.MetroMessageBox.Show(this, ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void gridBusinesses_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                Business business = businessBindingSource.Current as Business;
                tcntrlInfo.SelectedTab = tpageBusiness;

                clientOrderBindingSource1.DataSource = ClientOrderService.GetClientOrders(business.BusinessId, ClientType.Business);
                tpageBusiness.Enabled      = false;
                gridBusinessOrders.Enabled = true;
            }
            catch (Exception ex)
            {
                MetroFramework.MetroMessageBox.Show(this, ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public ClientOrderController()
 {
     this.objOrder = new ClientOrderService();
 }