public ActionResult TrangNopDon(TinTucTuyenDung tttd, FormCollection f) { string sNguoiNop = f.Get("name").ToString(); string sEmail = f.Get("email").ToString(); string sSDT = f.Get("sdt").ToString(); string sGT = f.Get("message").ToString(); Session["sNguoiNop"] = sNguoiNop; Session["sEmail"] = sEmail; Session["sSDT"] = sSDT; Session["sGT"] = sGT; int id = int.Parse(Session["IDTD"].ToString()); tttd = td.TinTucTuyenDung.SingleOrDefault(n => n.IDTT == id); var nd = new NOPDON(); nd.IDTT = tttd.IDTT; nd.CongTy = tttd.TenCT; nd.NgayNop = DateTime.Now; nd.NguoiNop = Session["sNguoiNop"].ToString(); nd.Hanchot = tttd.Thoihan; nd.Yeucau = tttd.Yeucau; nd.Vitri = tttd.Vitri; nd.Email = Session["sEmail"].ToString(); nd.SDT = Session["sSDT"].ToString(); nd.Gioithieubanthan = sGT; td.NOPDON.Add(nd); td.SaveChanges(); return(RedirectToAction("TrangChu", "Home")); }
public ActionResult XacNhanXoa(int IDTT) { NOPDON don = td.NOPDON.SingleOrDefault(n => n.IDTT == IDTT); if (don == null) { Response.StatusCode = 404; return(null); } td.NOPDON.Remove(don); td.SaveChanges(); return(Redirect("~/Home/DonNguoiDung")); }
public ActionResult XoaDonNguoiDung(int IDTT) { //Lấy Đối tượng sách theo mã NOPDON don = td.NOPDON.SingleOrDefault(n => n.IDTT == IDTT); if (don == null) { Response.StatusCode = 404; return(null); } return(View(don)); }
public ActionResult Nopdon(int id, string strURL) { NOPDON nd = new NOPDON(); if (Session["TaikhoanCN"] == null || Session["TaikhoanCN"].ToString() == "") { return(RedirectToAction("DangNhap", "NguoiDung")); } else { nd.MATKCN = int.Parse(Session["TaikhoanCN"].ToString()); nd.MAPDT = id; nd.NGAYNOPDON = DateTime.Now; nd.TINHTRANG = false; db.NOPDONs.InsertOnSubmit(nd); db.SubmitChanges(); } return(Redirect(strURL)); }