public IHttpActionResult PutCustomer_Slut_Table(int id, Customer_Slut_Table customer_Slut_Table) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != customer_Slut_Table.Customer_Slut_ID) { return(BadRequest()); } db.Entry(customer_Slut_Table).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Customer_Slut_TableExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { Customer_Slut_Table customer_Slut_Table = db.Customer_Slut_Table.Find(id); db.Customer_Slut_Table.Remove(customer_Slut_Table); db.SaveChanges(); return(RedirectToAction("Index")); }
public IHttpActionResult GetCustomer_Slut_Table(int id) { Customer_Slut_Table customer_Slut_Table = db.Customer_Slut_Table.Find(id); if (customer_Slut_Table == null) { return(NotFound()); } return(Ok(customer_Slut_Table)); }
public IHttpActionResult PostCustomer_Slut_Table(Customer_Slut_Table customer_Slut_Table) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Customer_Slut_Table.Add(customer_Slut_Table); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = customer_Slut_Table.Customer_Slut_ID }, customer_Slut_Table)); }
public IHttpActionResult DeleteCustomer_Slut_Table(int id) { Customer_Slut_Table customer_Slut_Table = db.Customer_Slut_Table.Find(id); if (customer_Slut_Table == null) { return(NotFound()); } db.Customer_Slut_Table.Remove(customer_Slut_Table); db.SaveChanges(); return(Ok(customer_Slut_Table)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Customer_Slut_Table customer_Slut_Table = db.Customer_Slut_Table.Find(id); if (customer_Slut_Table == null) { return(HttpNotFound()); } return(View(customer_Slut_Table)); }
public ActionResult Edit([Bind(Include = "Customer_Slut_ID,Customer_ID,Slut_ID,Car_Spe_ID,Cus_Slut_Date,Cus_Slut_S_Time,Cus_Slut_E_Time,Cheeck_Code")] Customer_Slut_Table customer_Slut_Table) { if (ModelState.IsValid) { db.Entry(customer_Slut_Table).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ApplicationUser user = System.Web.HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); ViewBag.Customer = user.Id; ViewBag.Car_Specifications = db.Car_Specifications_Table.Where(c => c.Car_Owner_ID == user.Id).ToList(); ViewBag.Slut_ID = db.Slut_Table.ToList(); ViewBag.Governorate_Table = db.Governorate_Table.ToList(); return(View(customer_Slut_Table)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Customer_Slut_Table customer_Slut_Table = db.Customer_Slut_Table.Find(id); if (customer_Slut_Table == null) { return(HttpNotFound()); } ApplicationUser user = System.Web.HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(System.Web.HttpContext.Current.User.Identity.GetUserId()); ViewBag.Customer = user.Id; ViewBag.Car_Specifications = db.Car_Specifications_Table.Where(c => c.Car_Owner_ID == user.Id).ToList(); ViewBag.Slut_ID = db.Slut_Table.ToList(); ViewBag.Governorate_Table = db.Governorate_Table.ToList(); return(View(customer_Slut_Table)); }