Exemplo n.º 1
0
 public Boolean Save(tbl_000_H_ITEM_FDC record)
 {
     using (var dbContextTransaction = db.Database.BeginTransaction())
     {
         try
         {
             db.ItemFDCList.Add(record);
             db.SaveChanges();
             dbContextTransaction.Commit();
             return(true);
         }
         catch (Exception ex)
         {
             dbContextTransaction.Rollback();
             throw ex;
         }
     }
 }
Exemplo n.º 2
0
 public Boolean Delete(tbl_000_H_ITEM_FDC record)
 {
     using (var dbContextTransaction = db.Database.BeginTransaction())
     {
         try
         {
             var existrecord = GetByID(record.YEARUSED, record.ItemNo, record.DepnType);
             db.ItemFDCList.Remove(existrecord);
             db.SaveChanges();
             dbContextTransaction.Commit();
             return(true);
         }
         catch (Exception ex)
         {
             dbContextTransaction.Rollback();
             throw ex;
         }
     }
 }
Exemplo n.º 3
0
 public Boolean Delete(tbl_000_H_ITEM_FDC record)
 {
     try
     {
         if (record == null)
         {
             throw new Exception("Invalid Parameter!");
         }
         if (!itfdcdal.IsExistID(record.YEARUSED, record.ItemNo, record.DepnType))
         {
             throw new Exception("Record does not exist!");
         }
         return(itfdcdal.Delete(record));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public Boolean Save(tbl_000_H_ITEM_FDC record)
 {
     try
     {
         if (record == null)
         {
             throw new Exception("Invalid Parameter!");
         }
         if (itfdcdal.IsExistID(record.YEARUSED, record.ItemNo, record.DepnType))
         {
             throw new Exception("MPT No. already taken!");
         }
         if (itfdcdal.IsExistDesc(record.Description))
         {
             throw new Exception("MPT Name already taken!");
         }
         return(itfdcdal.Save(record));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }