public bool SaveRevenueTypeById(RevenueType iRevenuetype) { try { if (iRevenuetype.RevenueTypeID > 0) { db.Entry(iRevenuetype).State = EntityState.Modified; db.SaveChanges(); } else { iRevenuetype.RevenueTypeID = GetMaxNumberRevenueType(); db.RevenueTypes.Add(iRevenuetype); db.SaveChanges(); } return(true); } catch (Exception) { return(false); throw; } //return false; }
public bool SaveRevenueType(RevenueType iRevenuetype) { try { iRevenuetype.RevenueTypeID = GetMaxNumberRevenueType(); db.RevenueTypes.Add(iRevenuetype); db.SaveChanges(); return(true); } catch (Exception) { return(false); throw; } //return false; }
public bool DeleteRevenueType(int iRevenueTypeId) { try { if (iRevenueTypeId > 0) { RevenueType revenueType = db.RevenueTypes.Find(iRevenueTypeId); db.RevenueTypes.Remove(revenueType); db.SaveChanges(); return(true); } } catch (Exception) { return(false); throw; } return(false); }