Esempio n. 1
0
 public ActionResult Edit(Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Customers.Attach(customer);
         db.ObjectStateManager.ChangeObjectState(customer, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(customer);
 }
Esempio n. 2
0
        public ActionResult Create(Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.Customers.AddObject(customer);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(customer);
        }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCustomers(Customer customer)
 {
     base.AddObject("Customers", customer);
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new Customer object.
 /// </summary>
 /// <param name="customerID">Initial value of the CustomerID property.</param>
 /// <param name="nameStyle">Initial value of the NameStyle property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 /// <param name="lastName">Initial value of the LastName property.</param>
 /// <param name="passwordHash">Initial value of the PasswordHash property.</param>
 /// <param name="passwordSalt">Initial value of the PasswordSalt property.</param>
 /// <param name="rowguid">Initial value of the rowguid property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static Customer CreateCustomer(global::System.Int32 customerID, global::System.Boolean nameStyle, global::System.String firstName, global::System.String lastName, global::System.String passwordHash, global::System.String passwordSalt, global::System.Guid rowguid, global::System.DateTime modifiedDate)
 {
     Customer customer = new Customer();
     customer.CustomerID = customerID;
     customer.NameStyle = nameStyle;
     customer.FirstName = firstName;
     customer.LastName = lastName;
     customer.PasswordHash = passwordHash;
     customer.PasswordSalt = passwordSalt;
     customer.rowguid = rowguid;
     customer.ModifiedDate = modifiedDate;
     return customer;
 }