public IActionResult CreatePost(AzOrders model) { if (ModelState.IsValid) { repository.Insert().With(s => s.CustomerID, model.CustomerID) .With(s => s.EmployeeID, model.EmployeeID) .With(s => s.OrderDate, model.OrderDate) .With(s => s.RequiredDate, model.RequiredDate) .With(s => s.ShippedDate, model.ShippedDate) .With(s => s.ShipVia, model.ShipVia) .With(s => s.Freight, model.Freight) .With(s => s.ShipName, model.ShipName) .With(s => s.ShipAddress, model.ShipAddress) .With(s => s.ShipCity, model.ShipCity) .With(s => s.ShipRegion, model.ShipRegion) .With(s => s.ShipPostalCode, model.ShipPostalCode) .With(s => s.ShipCountry, model.ShipCountry) .Go(); //按增加保存 return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Create() { var model = new AzOrders(); return(View(model)); }
public IActionResult DeleteConfirmed(AzOrders model) { repository.Delete().Where(c => c.OrderID == model.OrderID).Go(); return(RedirectToAction("Index")); }