public async Task <IHttpActionResult> PostRetaileler(Retaileler retaileler) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Retailelers.Add(retaileler); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (RetailelerExists(retaileler.UserID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = retaileler.UserID }, retaileler)); }
public async Task <IHttpActionResult> PutRetaileler(string id, Retaileler retaileler) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != retaileler.UserID) { return(BadRequest()); } db.Entry(retaileler).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RetailelerExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult> DeleteConfirmed(string id) { Retaileler retaileler = await db.Retailelers.FindAsync(id); db.Retailelers.Remove(retaileler); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <IHttpActionResult> GetRetaileler(string id) { Retaileler retaileler = await db.Retailelers.FindAsync(id); if (retaileler == null) { return(NotFound()); } return(Ok(retaileler)); }
public async Task <ActionResult> Edit([Bind(Include = "UserID,RetailerName,CompanyContactNumber,CompanyEmail,ProfilePhotoPath,ProofOfResedence,Signature,CompanyDescription")] Retaileler retaileler) { if (ModelState.IsValid) { db.Entry(retaileler).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.UserID = new SelectList(db.Sellers, "UserID", "FirtstName", retaileler.UserID); return(View(retaileler)); }
// GET: Retailelers/Details/5 public async Task <ActionResult> Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Retaileler retaileler = await db.Retailelers.FindAsync(id); if (retaileler == null) { return(HttpNotFound()); } return(View(retaileler)); }
public async Task <IHttpActionResult> DeleteRetaileler(string id) { Retaileler retaileler = await db.Retailelers.FindAsync(id); if (retaileler == null) { return(NotFound()); } db.Retailelers.Remove(retaileler); await db.SaveChangesAsync(); return(Ok(retaileler)); }
// GET: Retailelers/Edit/5 public async Task <ActionResult> Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Retaileler retaileler = await db.Retailelers.FindAsync(id); if (retaileler == null) { return(HttpNotFound()); } ViewBag.UserID = new SelectList(db.Sellers, "UserID", "FirtstName", retaileler.UserID); return(View(retaileler)); }