private void btnEdit_Click(object sender, EventArgs e) { Form frmaddCustomer = new AddCustomer(currentSelectID); frmaddCustomer.ShowDialog(); refreshCustomers(); }
private void button1_Click(object sender, EventArgs e) { GUI.AddCustomer ac = new AddCustomer(); this.Hide(); ac.ShowDialog(); this.Show(); }
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(); } }
private void btnAdd_Click(object sender, EventArgs e) { Form frmaddCustomer = new AddCustomer(); frmaddCustomer.ShowDialog(); refreshCustomers(); }
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); } }
private void buttonAdd_Click(object sender, RoutedEventArgs e) { var asa = _accountService.getCustomer(5); if (_isCustomersSelected) { var addCustomerWindow = new AddCustomer(); addCustomerWindow.superView = this; addCustomerWindow.ShowDialog(); } }
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); } }
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"); }
public void AddCustomer_Click() { AddCustomer _AC = new AddCustomer(); _AC.ShowDialog(); }
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(); }
private void btnAddCon_Click(object sender, EventArgs e) { AddCustomer add = new AddCustomer(); add.ShowDialog(); }
private void button10_Click_1(object sender, EventArgs e) { AddCustomer ad = new AddCustomer(); ad.ShowDialog(); }