Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Form frmaddCustomer = new AddCustomer(currentSelectID);

            frmaddCustomer.ShowDialog();
            refreshCustomers();
        }
Ejemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     GUI.AddCustomer ac = new AddCustomer();
     this.Hide();
     ac.ShowDialog();
     this.Show();
 }
Ejemplo n.º 3
0
        private void NewItem_Click(object sender, EventArgs e)
        {
            if (order == null)
            {
                NewOrder();
            }

            if (order != null)
            {
                if (order.CustomerObj == null)
                {
                    AddCustomer form = new AddCustomer(order);
                    form.ShowDialog();
                    if (form.DialogResult == DialogResult.OK)
                    {
                        if (order.CustomerObj == null)
                        {
                            order.CustomerObj = new Customer();
                        }
                        order.CustomerObj.CustomerNum = support.GetContextNum();
                    }
                }

                if (order.CustomerObj != null)
                {
                    AddItem form1 = new AddItem(order, itemList);
                    form1.ShowDialog();
                }
                RefreshScreen();
            }
        }
Ejemplo n.º 4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Form frmaddCustomer = new AddCustomer();

            frmaddCustomer.ShowDialog();
            refreshCustomers();
        }
Ejemplo n.º 5
0
        private void btnAddCustomer_Click(object sender, EventArgs e)
        {
            AddCustomer  cusForm = new AddCustomer();
            DialogResult dr      = cusForm.ShowDialog();

            if (dr == DialogResult.OK)
            {
                lbxCustomer.Items.Add(cusForm.customer);
            }
        }
Ejemplo n.º 6
0
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            var asa = _accountService.getCustomer(5);

            if (_isCustomersSelected)
            {
                var addCustomerWindow = new AddCustomer();
                addCustomerWindow.superView = this;
                addCustomerWindow.ShowDialog();
            }
        }
Ejemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            Customer     changeCustomer = lbxCustomer.SelectedItem as Customer;
            AddCustomer  cust           = new AddCustomer(changeCustomer);
            DialogResult dr             = cust.ShowDialog();

            if (dr == DialogResult.OK)
            {
                lbxCustomer.Items.Remove(lbxCustomer.SelectedItem);
                lbxCustomer.Items.Add(changeCustomer);
            }
        }
Ejemplo n.º 8
0
        public Customer AddCustomer()
        {
            _mView = new AddCustomer();

            AddCustomerViewModel cViewModel = new AddCustomerViewModel();

            cViewModel.Model         = new Customer();
            cViewModel.OkCommand     = new RelayCommand(ExecuteOkCommand);
            cViewModel.CancelCommand = new RelayCommand(ExecuteCancelCommand);

            _mView.DataContext = cViewModel;
            return(_mView.ShowDialog() == true ? cViewModel.Model : null);
        }
        public void AddCustomer()
        {
            customer    cust      = new customer();
            AddCustomer addWindow = new AddCustomer();

            // Sets the window's context and gives it the types available, that aren't deleted
            addWindow.DataContext = new { customer = cust };
            addWindow.ShowDialog();

            try
            {
                dataHandler.AddOrUpdate(cust);
            }
            catch (Exception e)
            {
                System.Windows.MessageBox.Show("Error: " + e.Message);
            }
            NotifyOfPropertyChange("Customers");
        }
        public void Modify(customer cust)
        {
            AddCustomer addWindow = new AddCustomer();

            // Sets the window's context and gives it the types available, that aren't deleted
            addWindow.DataContext = new { customer = cust };
            if (addWindow.ShowDialog() == true)
            {
                try
                {
                    dataHandler.AddOrUpdate(cust);
                }
                catch (Exception e)
                {
                    System.Windows.MessageBox.Show("Error: " + e.Message);
                }
            }
            else
            {
                ((System.Data.Entity.Infrastructure.IObjectContextAdapter)dataHandler.GetEntities()).ObjectContext.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, cust);
            }
            NotifyOfPropertyChange("Customers");
        }
Ejemplo n.º 11
0
        public void AddCustomer_Click()
        {
            AddCustomer _AC = new AddCustomer();

            _AC.ShowDialog();
        }
Ejemplo n.º 12
0
        public async void Edit_Customer()
        {
            try
            {
                if (selectCustomer.CUSTOMER_ID != null && selectCustomer.CUSTOMER_ID != 0)
                {
                    data = null;
                    App.Current.Properties["Action"] = "Edit";



                    HttpClient client = new HttpClient();
                    client.BaseAddress = new Uri(GlobalData.gblApiAdress);
                    client.DefaultRequestHeaders.Accept.Add(
                        new MediaTypeWithQualityHeaderValue("application/json"));
                    client.Timeout = new TimeSpan(500000000000);
                    HttpResponseMessage response = client.GetAsync("api/CustomerAPI/EditCustomers/?id=" + selectCustomer.CUSTOMER_ID + "").Result;
                    //response = client.GetAsync("api/DeliveryAddressAPI/EditDelivery/?id=" + selectDelivery.DELIVERY_ID + "").Result;
                    if (response.StatusCode.ToString() == "OK")
                    {
                        data = JsonConvert.DeserializeObject <CustomerModel[]>(await response.Content.ReadAsStringAsync());
                        if (data.Length > 0)
                        {
                            for (int i = 0; i < data.Length; i++)
                            {
                                CUSTOMER_CODE = data[i].CUSTOMER_CODE;
                                CUSTOMER_NAME = data[i].CUSTOMER_NAME;
                                ADDRESS       = data[i].ADDRESS;
                                COUNTRY       = data[i].COUNTRY;
                                POSTCODE      = data[i].POSTCODE;
                                CUSTOMER_ID   = data[i].CUSTOMER_ID;

                                //string date = null;
                                //if (data[i].DATE_STARTED != null)
                                //{
                                //    date = data[i].DATE_STARTED.ToString();
                                //}
                                WEBSITE      = data[i].WEBSITE;
                                VAT_TYPE     = data[i].VAT_TYPE;
                                PRICE_TYPE   = data[i].PRICE_TYPE;
                                DYNAMIC_DISC = data[i].DYNAMIC_DISC;
                                SEND_MAIL    = data[i].SEND_MAIL;
                                //COMPANY_ID = a.COMPANY_ID,
                                CUSTOMER_INACTIVE = data[i].CUSTOMER_STATUS;
                                REGISTERED        = data[i].REGISTERED;
                                DUNS_NO           = data[i].DUNS_NO;
                                STATEMENT         = data[i].STATEMENT;
                                IS_SUPPLIER       = data[i].IS_SUPPLIER;

                                CONTACT_TYPE       = data[i].CONTACT_TYPE;
                                CONTACT_NAME       = data[i].CONTACT_NAME;
                                CONTACT_SALUTATION = data[i].CONTACT_SALUTATION;
                                CONTACT_PHONE_NO   = data[i].CONTACT_PHONE_NO;
                                CONTACT_EXTN_NO    = data[i].CONTACT_EXTN_NO;
                                CONTACT_MOBILE_NO  = data[i].CONTACT_MOBILE_NO;
                                CONTACT_FAX        = data[i].CONTACT_FAX;
                                EMAIL = data[i].EMAIL;
                                SKYPE = data[i].SKYPE;


                                DATE_STARTED = data[i].DATE_STARTED;
                            }

                            App.Current.Properties["CustomerEdit"] = selectCustomer;
                            AddCustomer _AC = new AddCustomer();
                            _AC.ShowDialog();
                        }
                    }
                }

                else
                {
                    MessageBox.Show("Select Customer first", "Item Selection", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        private void btnAddNewCustomer_Click(object sender, EventArgs e)
        {
            AddCustomer newCus = new AddCustomer();

            newCus.ShowDialog();
        }
Ejemplo n.º 14
0
        private void btnAddCon_Click(object sender, EventArgs e)
        {
            AddCustomer add = new AddCustomer();

            add.ShowDialog();
        }
Ejemplo n.º 15
0
        private void button10_Click_1(object sender, EventArgs e)
        {
            AddCustomer ad = new AddCustomer();

            ad.ShowDialog();
        }