public bool AddRegionalCharges(tbl_Regional_Charges row) { try { using (var db = new SoneriCISEntities()) { db.tbl_Regional_Charges.Add(row); db.SaveChanges(); } return(true); } catch (Exception ex) { return(false); } }
public bool AddCardChargesWithRegionalCharges(tbl_Card_Charges CardCharges, tbl_Regional_Charges RegionalCharges) { try { using (var db = new SoneriCISEntities()) { db.tbl_Card_Charges.Add(CardCharges); db.SaveChanges(); RegionalCharges.CardChargeID = CardCharges.ID; AddRegionalCharges(RegionalCharges); } return(true); } catch (Exception ex) { return(false); } }
public bool UpdateRegionalCharges(tbl_Regional_Charges row) { try { using (var db = new SoneriCISEntities()) { tbl_Regional_Charges val = new DAL.tbl_Regional_Charges(); val = db.tbl_Regional_Charges.Where(a => a.ID == row.ID).FirstOrDefault(); val.PercentageAmount = row.PercentageAmount; val.RegionID = row.RegionID; val.CardChargeID = row.CardChargeID; val.TotalAmount = row.TotalAmount; db.SaveChanges(); } return(true); } catch (Exception ex) { return(false); } }