public static bool Remove(VisitDrug item) { EntityModelContainer context = GetContext(); try { context.DeleteObject(item); } catch { Methods.ShowStandardMsgBox(FormMessageType.Error, RscError.ErrorTitle, RscError.EntityDelete); context.ObjectStateManager.ChangeObjectState(item, System.Data.EntityState.Modified); return false; } return true; }
/// <summary> /// Create a new VisitDrug object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="visitId">Initial value of the VisitId property.</param> /// <param name="drugId">Initial value of the DrugId property.</param> public static VisitDrug CreateVisitDrug(global::System.Int32 id, global::System.Int32 visitId, global::System.Int32 drugId) { VisitDrug visitDrug = new VisitDrug(); visitDrug.Id = id; visitDrug.VisitId = visitId; visitDrug.DrugId = drugId; return visitDrug; }
public static bool Validate(VisitDrug entity) { if (entity == null || entity.DrugId == 0) { Methods.ShowStandardMsgBox(FormMessageType.Error, RscError.ValidationTitle, RscError.DrugTitleNull); return false; } return true; }
/// <summary> /// Deprecated Method for adding a new object to the VisitDrugs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToVisitDrugs(VisitDrug visitDrug) { base.AddObject("VisitDrugs", visitDrug); }