public void GuardarPatologia(int id, string diagnostico) { try { DataAccess.diagnostico diag = new DataAccess.diagnostico(); diag.id = id; diag.diagnostico1 = diagnostico; entities.diagnosticos.AddObject(diag); //Se guarda en memoria entities.SaveChanges();//Se guarda en la base de datos } catch (Exception err) { throw new Exception(err.ToString() + "--Diagnostico.cs / GuardarDiagnostico()"); } }
/// <summary> /// Deprecated Method for adding a new object to the diagnosticos EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTodiagnosticos(diagnostico diagnostico) { base.AddObject("diagnosticos", diagnostico); }
/// <summary> /// Create a new diagnostico object. /// </summary> /// <param name="diagnostico1">Initial value of the diagnostico1 property.</param> /// <param name="id">Initial value of the id property.</param> public static diagnostico Creatediagnostico(global::System.String diagnostico1, global::System.Int64 id) { diagnostico diagnostico = new diagnostico(); diagnostico.diagnostico1 = diagnostico1; diagnostico.id = id; return diagnostico; }