コード例 #1
0
 public void Put(int id, bool isCompleted, string answer)
 {
     using (var db = new EntiTreesEntities())
     {
         db.UpdateContact(id, isCompleted, answer);
     }
 }
コード例 #2
0
 public Models.ReturnValue <string> Put(int id, string email, string name, string message)
 {
     using (var db = new EntiTreesEntities())
     {
         try
         {
             Utils.SendMail("Отговор на запитване от Енти Трийс", message, email, name);
             db.UpdateContact(id, true, message);
             return(new Models.ReturnValue <string>(Models.Codes.OK, "Successfully send message back to contact."));
         }
         catch (Exception ex)
         {
             db.UpdateContact(id, false, "");
             return(new Models.ReturnValue <string>(Models.Codes.Error, ex.Message));
         }
     }
 }