public ActionResult Contact(string Contact, string ID) { var userSession = Session[Common.CommonConstants.USER_SESSION]; var gopyDao = new ContactDao(); var cont = new GopY_KH(); cont.IdGopY = ID; cont.IdUser = ((UserLogin)userSession).UserID; cont.NoiDung = Contact; cont.NgayGopY = DateTime.Now; gopyDao.ThemGopY(cont); return(RedirectToAction("Index", "Home")); }
public ActionResult Create(string content) { long iduser = new UserDao().getIdUser(); var feedback = new GopY_KH(); feedback.IdUser = iduser; feedback.NoiDung = content; feedback.NgayTao = DateTime.Now; feedback.TrangThai = true; try { var id1 = new ContactDao().Insert(feedback); } catch (Exception e) { return(Redirect("/loi-gui-don")); } return(Redirect("/Contact/Success")); }
public long Insert(GopY_KH contact) { db.GopY_KH.Add(contact); db.SaveChanges(); return(contact.IdGopY); }
public void ThemGopY(GopY_KH g) { db.GopY_KHs.Add(g); db.SaveChanges(); }