public ActionResult Edit([Bind(Include = "id,tenloaitintuc,ngaytao,ngaycapnhat,nguoitao,daxoa,hinhanhtintuc,motasoluoc,ghichu")] admin_loaitintuc admin_loaitintuc) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { admin_loaitintuc.ngaycapnhat = DateTime.Now; db.Entry(admin_loaitintuc).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(admin_loaitintuc)); }
public ActionResult Edit([Bind(Include = "id,tenloaihanhtrinh,ngaytao,ngaycapnhat,hienthi,nguoitao")] admin_loaihanhtrinh admin_loaihanhtrinh) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { admin_loaihanhtrinh.ngaycapnhat = DateTime.Now; db.Entry(admin_loaihanhtrinh).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_loaihanhtrinh.nguoitao); return(View(admin_loaihanhtrinh)); }
public ActionResult Edit([Bind(Include = "id,tennhomthanhvien,motanhom,ngaytao,ngaycapnhat,nguoitao,daxoa,ghichu,hinhdaidien")] admin_nhomthanhvien admin_nhomthanhvien) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { admin_nhomthanhvien.ngaycapnhat = DateTime.Now; db.Entry(admin_nhomthanhvien).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_nhomthanhvien.nguoitao); return(View(admin_nhomthanhvien)); }
public ActionResult Edit([Bind(Include = "id,tenbailienhe,tenbailienhe_en,noidung,noidung_en,hienthi,daxoa,ngaytao,ngaycapnhat,nguoitao,thutuhienthi,ghichu")] admin_baivietlienhe admin_baivietlienhe) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { db.Entry(admin_baivietlienhe).State = EntityState.Modified; admin_baivietlienhe.ngaycapnhat = DateTime.Now; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_baivietlienhe.nguoitao); return(View(admin_baivietlienhe)); }
// GET: Admin/Shared public ActionResult _LoginName() { try { if (Session["User"] != null) { admin_account u = Session["User"] as admin_account; admin_account currentuser = db.admin_account.Find(u.id); currentuser.landangnhapcuoi = DateTime.Now; db.Entry(currentuser).State = EntityState.Modified; db.SaveChanges(); ViewBag.LoginName = currentuser.hoten; return(PartialView("_LoginName")); } else { Session.Clear(); return(PartialView("_LoginName")); } } catch (Exception ex) { } Session.Clear(); return(PartialView("_LoginName")); }
public ActionResult Edit([Bind(Include = "id,tentintuc,tentintuc_en,hinhdaidien,loaitintuc,ngaytao,ngaycapnhat,nguoitao,motasoluoc,motasoluoc_en,noidungtintuc,noidungtintuc_en,daxoa,ghichu,hienthi")] admin_tintuc admin_tintuc) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { admin_tintuc.ngaycapnhat = DateTime.Now; db.Entry(admin_tintuc).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_tintuc.nguoitao); ViewBag.loaitintuc = new SelectList(db.admin_loaitintuc, "id", "tenloaitintuc", admin_tintuc.loaitintuc); return(View(admin_tintuc)); }
public ActionResult Edit([Bind(Include = "id,tenhanhtrinh,tenhanhtrinh_en,hinhdaidien,loaihanhtrinh,ngaytao,thongtinthoigian,thongtindiadiem,diadiem_en,motasoluoc,motasoluoc_en,noidung,noidung_en,hienthi,nguoitao")] admin_hanhtrinh admin_hanhtrinh) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { admin_hanhtrinh.ngaycapnhat = DateTime.Now; db.Entry(admin_hanhtrinh).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_hanhtrinh.nguoitao); ViewBag.loaihanhtrinh = new SelectList(db.admin_loaihanhtrinh, "id", "tenloaihanhtrinh", admin_hanhtrinh.loaihanhtrinh); return(View(admin_hanhtrinh)); }
public ActionResult Edit([Bind(Include = "id,tenbanner,urlbanner,motabanner,ghichu,ngaytao,ngaycapnhat,nguoitao,hienthi,thutuhien,daxoa,loaibanner")] banner banner) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { banner.ngaycapnhat = DateTime.Now; db.Entry(banner).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", banner.nguoitao); ViewBag.loaibanner = new SelectList(db.loaibanners, "id", "tenloaibanner", banner.loaibanner); return(View(banner)); }
public ActionResult Edit([Bind(Include = "id,tenhinhanh,urlhinhanh,ngaytao,ngaycapnhat,nguoitao,loaihinhanh,thutuhien,daxoa,ghichu")] admin_hinhanh admin_hinhanh) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } if (ModelState.IsValid) { admin_hinhanh.ngaycapnhat = DateTime.Now; db.Entry(admin_hinhanh).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_hinhanh.nguoitao); ViewBag.loaihinhanh = new SelectList(db.admin_loaihinhanh, "id", "tenloaihinhanh", admin_hinhanh.loaihinhanh); ViewBag._hinhdaidien = "../../" + admin_hinhanh.urlhinhanh; return(View(admin_hinhanh)); }
public ActionResult Edit([Bind(Include = "id,username,password,ngaytao,landangnhapcuoi,hoten,gioitinh,ghichu,quyen,daxoa")] admin_account admin_account) { if (ModelState.IsValid) { admin_account.landangnhapcuoi = DateTime.Now; db.Entry(admin_account).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(admin_account)); }
public ActionResult Edit([Bind(Include = "id,tenthanhvien,motasoluoc,chitiet,urlhinhanh,ngaytao,ngaycapnhat,nguoitao,daxoa,ghichu,nhomthanhvien,hienthi,tenthanhvien_en,motasoluoc_en,chitiet_en,thutuhienthi")] admin_thanhvien admin_thanhvien) { if (ModelState.IsValid) { db.Entry(admin_thanhvien).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.nguoitao = new SelectList(db.admin_account, "id", "username", admin_thanhvien.nguoitao); ViewBag.nhomthanhvien = new SelectList(db.admin_nhomthanhvien, "id", "tennhomthanhvien", admin_thanhvien.nhomthanhvien); return(View(admin_thanhvien)); }
public ActionResult Login(admin_account account) { admin_account u = db.admin_account.Where(m => m.username == account.username && m.password == account.password).FirstOrDefault(); if (u != null) { Session["User"] = u; DateTime _now = System.DateTime.Now; u.landangnhapcuoi = _now; db.admin_account.Attach(u); db.Entry(u).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "HanhTrinh")); } else { Session["User"] = null; ViewBag.Message = ""; ViewBag.Message = "Sai tài khoản hoặc mật khẩu"; return(View()); } }
public ActionResult Edit([Bind(Include = "id,diachi,diachi_en,dienthoai,website,fax,mail,logo,diachigmap,baiviettrangchu,baiviettrangchu_en")] admin_thongtincodinh admin_thongtincodinh) { if (Session["User"] == null) { return(RedirectToAction("Logout", "Account")); } ViewBag.vdgmap0 = "<iframe src=\""; ViewBag.vdgmap1 = "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3919.512525748049!2d106.70210481464707!3d10.772002292324546!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x31752f4137df72b7%3A0x1351d358bc2fe73!2zQklURVhDTywgTmfDtCDEkOG7qWMgS-G6vywgQuG6v24gTmdow6ksIFF14bqtbiAxLCBI4buTIENow60gTWluaCwgVmnhu4d0IE5hbQ!5e0!3m2!1svi!2s!4v1534016393545"; ViewBag.vdgmap2 = "\" width=\"800\" height=\"600\" frameborder=\"0\" style=\"border:0\" allowfullscreen></iframe>"; if (ModelState.IsValid) { db.Entry(admin_thongtincodinh).State = EntityState.Modified; db.SaveChanges(); //return RedirectToAction("Index"); View(admin_thongtincodinh); } return(View(admin_thongtincodinh)); }