コード例 #1
0
 private void CloseAddNewCustomerHandler(object sender, EventArgs e)
 {
     if (((EditForm)sender).DialogResult == DialogResult.OK)
     {
         context.AddToCustomers(newCustomer);
         SaveChandes();
     }
     newCustomer = null;
 }
コード例 #2
0
 void CloseAddNewCustomerHandler(object sender, EventArgs e)
 {
     if (((DXDialog)sender).DialogResult == DialogResult.OK)
     {
         context.AddToCustomers(newCustomer);
         SaveChandes();
     }
     control     = null;
     newCustomer = null;
 }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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);
        }