private void btnOk_Click(object sender, EventArgs e) { var focusedRow = grdCustomerView.GetFocusedRow() as CustomerDto; if (focusedRow != null) { // Check if the user select a customer if (focusedRow.Id > -1) { var request = new CustomerRequest(); request.CustomerId = focusedRow.Id; // Needed for Interceptor request.Customer = new CustomerDto() { Name = focusedRow.Name}; Tag = new CustomerFactory().GetCustomer(request).Customer; DialogResult = System.Windows.Forms.DialogResult.OK; } else { // Check if is a new customer } } }
private void saveContact() { var request = new CustomerRequest(); request.CustomerContact = captureContact(); var response = new CustomerFactory().SaveCustomerContact(request); if (response.CustomerContactId > 0) { Tag = new CustomerFactory().GetCustomerContact(new CustomerRequest { CustomerContactId = response.CustomerContactId }).CustomerContact; } }
private void saveCustomer() { var request = new CustomerRequest(); request.Customer = captureCustomer(); request.CustomerId = new CustomerFactory().SaveCustomer(request).CustomerId; // Put the new customer on Tag Tag = new CustomerFactory().GetCustomer(request).Customer; this.DialogResult = System.Windows.Forms.DialogResult.OK; }