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; } } }
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; } } }
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; } }
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; } }