Exemple #1
0
 public bool Update(tb_Contact entity)
 {
     try
     {
         db.Entry(entity).State = EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #2
0
        public ActionResult Contactf(string FullName, string Email, string Content)
        {
            var entity = new tb_Contact();

            entity.Date     = DateTime.Now;
            entity.Modified = DateTime.Now;
            entity.FullName = FullName;
            entity.Email    = Email;
            entity.Content  = Content;
            long Id = Contacts.Insert(entity);

            return(Redirect("/"));
        }
Exemple #3
0
 public long Insert(tb_Contact entity)
 {
     db.tb_Contact.Add(entity);
     db.SaveChanges();
     return(entity.Id);
 }