public ActionResult DeleteConfirmed(int id) { StudioOrder studioOrder = db.StudioOrders.Find(id); db.StudioOrders.Remove(studioOrder); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool CreateConfirm(StudioOrder stu) { if (StudioOrderList.Contains(stu)) { return(true); } else { return(false); } }
public ActionResult Studio(StudioOrder order) { if (ModelState.IsValid) { User user = Session["user"] as User; order.UserID = user.ID; db.StudioOrders.Add(order); db.SaveChanges(); return(RedirectToAction("Index", "Home")); } db.SaveChanges(); return(View()); }
// GET: Admin/StudioOrders/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudioOrder studioOrder = db.StudioOrders.Find(id); if (studioOrder == null) { return(HttpNotFound()); } return(View(studioOrder)); }
public ActionResult Delete(StudioOrder stu) { //StudioOrder stu = new StudioOrder(); //stu.Customer = collection["Customer"]; //stu.Phonenumber = collection["Phonenumber"]; //stu.Address = collection["Address"]; //stu.Location = collection["Location"]; if (StudioOrderList.Contains(stu)) { StudioOrderList.Remove(stu); } return(View(stu)); }
public ActionResult LoadStudioforDate(string date) { DateTime Date = Convert.ToDateTime(date); List <OrderType> orderTypes = db.OrderTypes.ToList(); StudioOrder OrderedstudioType = db.StudioOrders.Where(p => p.OrderDate == Date).FirstOrDefault(); for (int i = 0; i < orderTypes.Count; i++) { if (OrderedstudioType != null && orderTypes[i] == OrderedstudioType.OrderType) { orderTypes.Remove(orderTypes[i]); } } return(PartialView("_StudioTypesPartial", orderTypes)); }
public ActionResult Create(IFormCollection collection) { StudioOrder stu = new StudioOrder(); // tạo mới một đơn hàng rồi set các thuộc tính từ form html stu.Customer = collection["Customer"]; stu.Phonenumber = collection["Phonenumber"]; stu.Location = collection["Location"]; stu.Address = collection["Address"]; StudioOrderList.Add(stu); if (CreateConfirm(stu) == true) { return(View(stu)); } else { return(View(new StudioOrder { Customer = "false", Phonenumber = "false", Location = "false", Address = "false" })); } }