Esempio n. 1
0
 public bool DeleteOrder(tOrderBarcode el)
 {
     using (var trans = context.Database.BeginTransaction())
     {
         try
         {
             tOrderBarcode dbEntry = context.tOrderBarcode.Where(t => t.Code == el.Code).FirstOrDefault();
             if (dbEntry != null)
             {
                 context.tOrderBarcode.Remove(dbEntry);
                 context.SaveChanges();
                 trans.Commit();
             }
             else
             {
                 trans.Dispose();
             }
         }
         catch (Exception e)
         {
             trans.Rollback();
             return(false);
         }
     }
     return(true);
 }
Esempio n. 2
0
 public bool IsChanged(tOrderBarcode origOb, tOrderBarcode newOb)
 {
     if (origOb.Code == newOb.Code && origOb.Barcode == newOb.Barcode && origOb.IsActive == newOb.IsActive)
     {
         return(false);
     }
     return(true);
 }
Esempio n. 3
0
 public void AddBarcode(tOrderBarcode ob)
 {
     using (var trans = context.Database.BeginTransaction())
     {
         try
         {
             tOrderBarcode dbEntry = context.tOrderBarcode.Where(t => t.Barcode == ob.Barcode && t.Code == ob.Code).FirstOrDefault();
             context.tOrderBarcode.Remove(dbEntry);
             context.tOrderBarcode.Add(ob);
             context.SaveChanges();
             trans.Commit();
         }
         catch { trans.Rollback(); }
     }
 }
Esempio n. 4
0
 public bool IsListChanged(List <tOrderBarcode> list)
 {
     foreach (tOrderBarcode el in list)
     {
         tOrderBarcode dbEntry = context.tOrderBarcode.Where(t => t.Code == el.Code).FirstOrDefault();
         if (dbEntry != null)
         {
             if (IsChanged(dbEntry, el))
             {
                 return(true);
             }
         }
         else
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 5
0
 public void MarkBarcode(tOrderBarcode ob)
 {
 }