/**
  * Método para crear nuevo registro
  */
 public static void insert(String message, decimal id)
 {
     using (var conn = new db_entities()) {
         try {
             conn.SP_ALERT_INSERT(message, id, DateTime.Now, 0);
         } catch (Exception e) {
             throw e;
         }
     }
 }
        public static void refuseTask(decimal id, String message, decimal userId)
        {
            using (var conn = new db_entities()) {
                try {
                    var task = conn.tasks.Where(x => x.id == id).FirstOrDefault();

                    if (task != null)
                    {
                        task.task_status = "3";
                    }

                    conn.SaveChanges();

                    conn.SP_ALERT_INSERT(message, id, DateTime.Now, 0);

                    conn.SP_LOG_TASK(id, userId, DateTime.Now, "3");
                } catch (Exception e) {
                    throw e;
                }
            }
        }