public void SavePromotionalFareTaxes(PromotionalFareModel model, Int64 promotionalFareId) { //Save Air_PromotionalFareTaxes foreach (var tax in model.PromotionalFareSector.Taxes) { Air_PromotionalFareTaxes promotionalFareTaxes = new Air_PromotionalFareTaxes() { PromotionalFareId = promotionalFareId, TaxName = tax.TaxName, TaxAmount = (double)tax.TaxAmount }; entity.AddToAir_PromotionalFareTaxes(promotionalFareTaxes); } }
public void EditPromotionalFareTaxes(PromotionalFareModel model) { foreach (PromotionalFareTaxes tax in model.PromotionalFareSector.Taxes) { Air_PromotionalFareTaxes promotionalFareTaxToEdit = entity.Air_PromotionalFareTaxes.Where(x => x.PromotionalFareTaxId == tax.PromotionalFareTaxId).FirstOrDefault(); promotionalFareTaxToEdit.PromotionalFareTaxId = tax.PromotionalFareTaxId; promotionalFareTaxToEdit.PromotionalFareId = model.PromotionalFareSector.PromotionalFareId; promotionalFareTaxToEdit.TaxName = tax.TaxName; promotionalFareTaxToEdit.TaxAmount = (double)tax.TaxAmount; entity.ApplyCurrentValues(promotionalFareTaxToEdit.EntityKey.EntitySetName, promotionalFareTaxToEdit); } }
public EntityCollection <Air_PromotionalFareTaxes> SaveTax(PromotionalFareModel model) { EntityCollection <Air_PromotionalFareTaxes> segment = new EntityCollection <Air_PromotionalFareTaxes>(); //List<Air_PromotionalFareSegments> collection = new List<Air_PromotionalFareSegments>(); foreach (var item in model.PromotionalFareSector.Taxes) { Air_PromotionalFareTaxes single = new Air_PromotionalFareTaxes() { PromotionalFareId = item.PromotionalFareId, TaxName = item.TaxName, TaxAmount = item.TaxAmount }; segment.Add(single); } return(segment); }