public ActionResult Edit([Bind(Include = "MaDanhMuc,TenDanhMuc")] DanhMuc danhMuc) { if (ModelState.IsValid) { db.Entry(danhMuc).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(danhMuc)); }
public ActionResult Edit([Bind(Include = "MaThongTinNhom,TenTaiKhoan,MaNhom")] ThongTinNhom thongTinNhom) { if (ModelState.IsValid) { db.Entry(thongTinNhom).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MaNhom = new SelectList(db.Nhoms, "MaNhom", "TenNhom", thongTinNhom.MaNhom); return(View(thongTinNhom)); }
public ActionResult Edit([Bind(Include = "MaChuDe,TenChuDe,MaDanhMuc")] ChuDe chuDe) { if (ModelState.IsValid) { db.Entry(chuDe).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MaDanhMuc = new SelectList(db.DanhMucs, "MaDanhMuc", "TenDanhMuc", chuDe.MaDanhMuc); return(View(chuDe)); }
public ActionResult Edit([Bind(Include = "TenTaiKhoan,MatKhau,TenHienThi,HinhAnh,SoDienThoai,MaLoaiTaiKhoan")] TaiKhoan taiKhoan) { if (ModelState.IsValid) { if (Request.Files.Count > 0 && Request.Files[0].FileName.Trim() != "") { string[] _arr = Request.Files[0].FileName.Split('.'); string type = _arr[_arr.Length - 1]; taiKhoan.HinhAnh = taiKhoan.TenTaiKhoan + "." + type; Request.Files[0].SaveAs(Server.MapPath("~/Public/Upload/Img_TaiKhoan/") + taiKhoan.HinhAnh); } db.Entry(taiKhoan).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MaLoaiTaiKhoan = new SelectList(db.LoaiTaiKhoans, "MaLoaiTaiKhoan", "TenLoaiTaiKhoan", taiKhoan.MaLoaiTaiKhoan); return(View(taiKhoan)); }