예제 #1
0
        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;
        }
예제 #2
0
 /// <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;
 }
예제 #3
0
        public static bool Validate(VisitDrug entity)
        {
            if (entity == null || entity.DrugId == 0)
            {
                Methods.ShowStandardMsgBox(FormMessageType.Error, RscError.ValidationTitle, RscError.DrugTitleNull);
                return false;
            }

            return true;
        }
예제 #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the VisitDrugs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToVisitDrugs(VisitDrug visitDrug)
 {
     base.AddObject("VisitDrugs", visitDrug);
 }