public ActionResult EditProfile([Bind(Include = "Seller_ID,Seller_Name,Seller_Email,Seller_Phone,Seller_State,Seller_Password")] Seller_Details sd, HttpPostedFileBase image) { if (image != null) { sd.Seller_Photo = new byte[image.ContentLength]; image.InputStream.Read(sd.Seller_Photo, 0, image.ContentLength); } else { int id = (int)Session["sellerid"]; var img = Db.Seller_Details.Where(m => m.Seller_ID == id).Select(m => m.Seller_Photo).FirstOrDefault(); if (img != null) { sd.Seller_Photo = img; } } if (ModelState.IsValid) { sd.Seller_ID = (int)Session["sellerid"]; Db.Entry(sd).State = EntityState.Modified; Db.SaveChanges(); return(RedirectToAction("Profile")); } return(View(sd)); }
public ActionResult DeleteConfirmed(int id) { Seller_Details seller_Details = db.Seller_Details.Find(id); db.Seller_Details.Remove(seller_Details); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Seller_Name,Seller_Address,Seller_City,Seller_State,Seller_Pincode,Seller_EmailId,Seller_MobileNo,Seller_UserId,Seller_ImagePath,Seller_ImageName,Seller_Password")] Seller_Details seller_Details) { if (ModelState.IsValid) { db.Entry(seller_Details).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(seller_Details)); }
public ActionResult EditProfile(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Seller_Details sd = Db.Seller_Details.Find(id); if (sd == null) { return(HttpNotFound()); } return(View(sd)); }
// GET: Seller/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Seller_Details seller_Details = db.Seller_Details.Find(id); if (seller_Details == null) { return(HttpNotFound()); } return(View(seller_Details)); }
public ActionResult SellerRegistration(Seller_Details sd, HttpPostedFileBase image) { House_Rental Db = new House_Rental(); if (image != null) { sd.Seller_Photo = new byte[image.ContentLength]; image.InputStream.Read(sd.Seller_Photo, 0, image.ContentLength); } if (ModelState.IsValid) { Db.Seller_Details.Add(sd); Db.SaveChanges(); } return(RedirectToAction("SellerLogin", "Home")); }