public IHttpActionResult PutSystem_Company(long id, System_Company system_Company) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != system_Company.ID) { return(BadRequest()); } db.Entry(system_Company).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!System_CompanyExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(long id) { System_Company system_Company = db.System_Company.Find(id); db.System_Company.Remove(system_Company); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,CompanyName,CompanyShort,CompanyAddress,CompanyPhone,CompanyImg,CompanyKey,UrlAPI,NeedBindMobile,NeedBindCard,OrderID,Status")] System_Company system_Company) { if (ModelState.IsValid) { db.Entry(system_Company).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(system_Company)); }
public IHttpActionResult GetSystem_Company(long id) { System_Company system_Company = db.System_Company.Find(id); if (system_Company == null) { return(NotFound()); } return(Ok(system_Company)); }
public IHttpActionResult PostSystem_Company(System_Company system_Company) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.System_Company.Add(system_Company); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = system_Company.ID }, system_Company)); }
public IHttpActionResult DeleteSystem_Company(long id) { System_Company system_Company = db.System_Company.Find(id); if (system_Company == null) { return(NotFound()); } db.System_Company.Remove(system_Company); db.SaveChanges(); return(Ok(system_Company)); }
// GET: Company/Delete/5 public ActionResult Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } System_Company system_Company = db.System_Company.Find(id); if (system_Company == null) { return(HttpNotFound()); } return(View(system_Company)); }