public string EditAlerta(Alerta alerta) { if (ModelState.IsValid) { var db = new edayRoomEntities(); db.Alertas.Attach(alerta); db.ObjectStateManager.ChangeObjectState(alerta, EntityState.Modified); db.SaveChanges(); } return ""; }
/// <summary> /// Deprecated Method for adding a new object to the Alertas EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToAlertas(Alerta alerta) { base.AddObject("Alertas", alerta); }
public string CrearAlerta(Alerta alerta) { var db = new edayRoomEntities(); db.Alertas.AddObject(alerta); db.SaveChanges(); return new JavaScriptSerializer().Serialize(""); }
/// <summary> /// Create a new Alerta object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="blocking">Initial value of the blocking property.</param> /// <param name="regresivo">Initial value of the regresivo property.</param> /// <param name="tiempo">Initial value of the tiempo property.</param> public static Alerta CreateAlerta(global::System.Int32 id, global::System.String name, global::System.Boolean blocking, global::System.Boolean regresivo, global::System.Int32 tiempo) { Alerta alerta = new Alerta(); alerta.id = id; alerta.name = name; alerta.blocking = blocking; alerta.regresivo = regresivo; alerta.tiempo = tiempo; return alerta; }