public static IPQuoteAmountsModel Convert(ip_quote_amounts ipQuoteAmountsDB) { if (ipQuoteAmountsDB == null) { return(new IPQuoteAmountsModel()); } return(new IPQuoteAmountsModel() { quote_amount_id = ipQuoteAmountsDB.quote_amount_id, quote_id = ipQuoteAmountsDB.quote_id, quote_item_subtotal = ipQuoteAmountsDB.quote_item_subtotal, quote_discount = ipQuoteAmountsDB.quote_discount, quote_tax_total = ipQuoteAmountsDB.quote_tax_total, quote_total = ipQuoteAmountsDB.quote_total }); }
public void Add(IPQuoteAmountsModel iPQuoteAmountsModel) { if (iPQuoteAmountsModel == null) { //throw new ArgumentNullException(nameof(iPQuoteAmountsModel)); } if (iPQuoteAmountsModel.quote_amount_id == 0) { ip_quote_amounts ipQuoteAmountsDB = Mapper.Map(iPQuoteAmountsModel, new ip_quote_amounts()); AMDSystemsEntities.ip_quote_amounts.Add(ipQuoteAmountsDB); AMDSystemsEntities.SaveChanges(); } else { this.Update(iPQuoteAmountsModel); } }
public static ip_quote_amounts Map(IPQuoteAmountsModel iPQuoteAmountsModel, ip_quote_amounts ipQuoteAmountsDB) { if (iPQuoteAmountsModel == null) { //throw new ArgumentNullException(nameof(iPQuoteAmountsModel)); } if (ipQuoteAmountsDB == null) { //throw new ArgumentNullException(nameof(ipQuoteAmountsDB)); } ipQuoteAmountsDB.quote_id = iPQuoteAmountsModel.quote_id; ipQuoteAmountsDB.quote_item_subtotal = iPQuoteAmountsModel.quote_item_subtotal; ipQuoteAmountsDB.quote_discount = iPQuoteAmountsModel.quote_discount; ipQuoteAmountsDB.quote_tax_total = iPQuoteAmountsModel.quote_tax_total; ipQuoteAmountsDB.quote_total = iPQuoteAmountsModel.quote_total; return(ipQuoteAmountsDB); }