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"));
        }
Example #2
0
        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"));
        }
Example #3
0
 public long Insert(GopY_KH contact)
 {
     db.GopY_KH.Add(contact);
     db.SaveChanges();
     return(contact.IdGopY);
 }
Example #4
0
 public void ThemGopY(GopY_KH g)
 {
     db.GopY_KHs.Add(g);
     db.SaveChanges();
 }