public void Update(IPQuoteItemAmountsModel iPQuoteItemAmountsModel) { if (iPQuoteItemAmountsModel == null) { //throw new ArgumentNullException(nameof(iPQuoteItemAmountsModel)); } var ipQuoteItemAmountsDB = AMDSystemsEntities.ip_quote_item_amounts.Where(qia => qia.item_amount_id == iPQuoteItemAmountsModel.item_amount_id).FirstOrDefault(); Mapper.Map(iPQuoteItemAmountsModel, ipQuoteItemAmountsDB); AMDSystemsEntities.SaveChanges(); }
public void Add(IPQuoteItemAmountsModel iPQuoteItemAmountsModel) { if (iPQuoteItemAmountsModel == null) { //throw new ArgumentNullException(nameof(iPQuoteItemAmountsModel)); } ip_quote_item_amounts ipQuoteItemAmountsDB = Mapper.Map(iPQuoteItemAmountsModel, new ip_quote_item_amounts()); AMDSystemsEntities.ip_quote_item_amounts.Add(ipQuoteItemAmountsDB); AMDSystemsEntities.SaveChanges(); }
public static ip_quote_item_amounts Map(IPQuoteItemAmountsModel iPQuoteItemAmountsModel, ip_quote_item_amounts ipQuoteItemAmountsDB) { if (iPQuoteItemAmountsModel == null) { //throw new ArgumentNullException(nameof(iPQuoteItemAmountsModel)); } if (ipQuoteItemAmountsDB == null) { //throw new ArgumentNullException(nameof(ipQuoteItemAmountsDB)); } ipQuoteItemAmountsDB.item_discount = iPQuoteItemAmountsModel.item_discount; ipQuoteItemAmountsDB.item_id = iPQuoteItemAmountsModel.item_id; ipQuoteItemAmountsDB.item_subtotal = iPQuoteItemAmountsModel.item_subtotal; ipQuoteItemAmountsDB.item_tax_total = iPQuoteItemAmountsModel.item_tax_total; ipQuoteItemAmountsDB.item_total = iPQuoteItemAmountsModel.item_total; return(ipQuoteItemAmountsDB); }