Exemple #1
0
 public Boolean Save(tbl_000_H_ITEM_TABULATION_ASSY record)
 {
     using (var dbContextTransaction = db.Database.BeginTransaction())
     {
         try
         {
             db.ItemTabulationAssyList.Add(record);
             db.SaveChanges();
             dbContextTransaction.Commit();
             return(true);
         }
         catch (Exception ex)
         {
             dbContextTransaction.Rollback();
             throw ex;
         }
     }
 }
 public Boolean Delete(tbl_000_H_ITEM_TABULATION_ASSY record)
 {
     try
     {
         if (record == null)
         {
             throw new Exception("Invalid Parameter!");
         }
         if (!itassydal.IsExistID(record.DocID))
         {
             throw new Exception("Record does not exist!");
         }
         return(itassydal.Delete(record));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
 public Boolean Update(tbl_000_H_ITEM_TABULATION_ASSY record)
 {
     using (var dbContextTransaction = db.Database.BeginTransaction())
     {
         try
         {
             //var existrecord = GetByID(record.YEARUSED, record.ItemNo, record.PartNo);
             var existrecord = GetByID(record.DocID);
             db.Entry(existrecord).GetDatabaseValues().SetValues(record);
             db.SaveChanges();
             dbContextTransaction.Commit();
             return(true);
         }
         catch (Exception ex)
         {
             dbContextTransaction.Rollback();
             throw ex;
         }
     }
 }
 public Boolean Save(tbl_000_H_ITEM_TABULATION_ASSY record)
 {
     try
     {
         if (record == null)
         {
             throw new Exception("Invalid Parameter!");
         }
         if (itassydal.IsExistID(record.DocID))
         {
             throw new Exception("Assy No. already taken!");
         }
         if (itassydal.IsExistPartName(record.PartName))
         {
             throw new Exception(" Assy Name already taken!");
         }
         return(itassydal.Save(record));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }