private void CloseAddNewCustomerHandler(object sender, EventArgs e) { if (((EditForm)sender).DialogResult == DialogResult.OK) { context.AddToCustomers(newCustomer); SaveChandes(); } newCustomer = null; }
void CloseAddNewCustomerHandler(object sender, EventArgs e) { if (((DXDialog)sender).DialogResult == DialogResult.OK) { context.AddToCustomers(newCustomer); SaveChandes(); } control = null; newCustomer = null; }
public static void Insert(string CustomerID, string CompanyName) { NorthwindEntities _entities = new NorthwindEntities(serviceUri); _entities.SendingRequest += new EventHandler <SendingRequestEventArgs>(_entities_SendingRequest); _entities.AddToCustomers(new Customers() { CustomerID = CustomerID, CompanyName = CompanyName }); _entities.SaveChanges(); }
public void AddCustomer(string customerId, string companyName, string address, string city) { NorthwindLibrary.Customer customer = NorthwindLibrary.Customer.CreateCustomer(customerId, companyName); customer.City = city; customer.Address = address; modelEntities.AddToCustomers(customer); modelEntities.SaveChanges(); }
private List <Customer> AddCustomers(int count) { List <Customer> customers = new List <Customer>(); for (int i = 0; i < count; i++) { Customer customer = CreateCustomer(i); entities.AddToCustomers(customer); customers.Add(customer); } return(customers); }