public PromotionalFareModel GetPromotionalFareCreateModel() { GeneralProvider generalProvider = new GeneralProvider(); PromotionalFareModel model = new PromotionalFareModel(); PromotionalFareSector promotionalFareSector = new PromotionalFareSector(); List <PromotionalFareSegment> segments = new List <PromotionalFareSegment>(); PromotionalFareSegment segment = new PromotionalFareSegment(); var cities = generalProvider.GetAirlineCityList(); segment.FromCityList = cities; segment.ToCityList = cities; segments.Add(segment); promotionalFareSector.PromotionalFareSegment = segments; //promotionalFareSector.CityList = generalProvider.GetAirlineCityList(); promotionalFareSector.AirlinesList = generalProvider.GetInternationAirlinesList(1); var Airlines = generalProvider.GetInternationAirlinesList(1); segment.AirlineList = Airlines; promotionalFareSector.CurrencyList = generalProvider.GetCurrencyList(); model.PromotionalFareSector = promotionalFareSector; return(model); }
//*-******************************************************************************Edit Part***************************************************************************// public PromotionalFareModel GetPromotionalFareSegmentEdit(long id) { var Data = entity.Air_PromotionalFares.Where(x => x.PromotionalFareId == id).FirstOrDefault(); PromotionalFareModel model = new PromotionalFareModel(); PromotionalFareSector single = new PromotionalFareSector() { PromotionalFareId = Data.PromotionalFareId, BaseFare = Data.BaseFare, FareRule = Data.FareRules != null ? Data.FareRules : string.Empty, EffectiveFrom = Data.EffectiveFrom.Date, ExpireOn = Data.ExpireOn.Date, Status = Data.isActive, TotalSeatQuota = Data.Qutota, Note = Data.Notes, PromotionalFareSegment = GetPromotionalFareSegmentList(id), Taxes = GetPromotionalFareTaxesList(id), Currency = Data.Currencies.CurrencyCode, CurrencyId = Data.CurrencyId, CurrencyList = new SelectList(GetAllCurrencyList(), "CurrencyId", "CurrencyCode", Data.CurrencyId) }; model.PromotionalFareSector = single; return(model); }
//****************************************************************************************************************************************************************************************// public List <PromotionalFareSector> GetPromotionalFareSegment() { var Data = entity.Air_PromotionalFares.OrderByDescending(x => x.PromotionalFareId); List <PromotionalFareSector> collection = new List <PromotionalFareSector>(); foreach (var item in Data) { PromotionalFareSector single = new PromotionalFareSector() { PromotionalFareId = item.PromotionalFareId, BaseFare = item.BaseFare, FareRule = item.FareRules, EffectiveFrom = item.EffectiveFrom, ExpireOn = item.ExpireOn, Status = item.isActive, TotalSeatQuota = item.Qutota, Note = item.Notes, PromotionalFareSegment = GetPromotionalFareSegmentList(item.PromotionalFareId), Taxes = GetPromotionalFareTaxesList(item.PromotionalFareId), }; collection.Add(single); } return(collection); }
public ActionResult Index(int?pageNo, int?flag) { //UnIssuedDomesticTicketModel model = new UnIssuedDomesticTicketModel(); PromotionalFareSector model = new PromotionalFareSector(); //model.UsIssuedDomesticTicketList = promotionalFareProvider.ListUnIssuedPromotionalFareTicket(); model.PromotionalFareSectorList = promotionalFareProvider.GetPromotionalFareSegment(); //int currentPageNo = 0; int numberOfPage = 0; //if (pageNo == null) // pageNo = 1; //model.UsIssuedDomesticTicketList = promotionalFareProvider.GetUnIssuedPromotionalFareTicketByPagination(model, pageNo.Value, out currentPageNo, out numberOfPage, flag); //ViewData["TotalPages"] = numberOfPage; //ViewData["CurrentPage"] = currentPageNo; return(View(model)); }
public PromotionalFareModel GetPromotionalFareSetupEditModel(Int64 promotionalFareId) { GeneralProvider generalProvider = new GeneralProvider(); PromotionalFareModel model = new PromotionalFareModel(); PromotionalFareSector promotionalFareSector = new PromotionalFareSector(); Air_PromotionalFares promotionalFares = entity.Air_PromotionalFares.Where(x => x.PromotionalFareId == promotionalFareId).FirstOrDefault(); if (promotionalFares != null) { // promotionalFareSector.CityList = generalProvider.GetAirlineCityList(); //promotionalFareSector.AirlinesList = generalProvider.GetInternationAirlinesList(1); //promotionalFareSector.CurrencyList = generalProvider.GetCurrencyList(); //promotionalFareSector.PromotionalFareId = promotionalFares.PromotionalFareId; //promotionalFareSector.AirlineId = promotionalFares.AirlineId; //promotionalFareSector.TourCode = promotionalFares.TourCode; //promotionalFareSector.CurrencyId = promotionalFares.CurrencyId; //promotionalFareSector.BICClass = promotionalFares.Class; //promotionalFareSector.FareBasis = promotionalFares.FareBasis; //promotionalFareSector.EffectiveFrom = promotionalFares.EffectiveFrom; //promotionalFareSector.ExpireOn = promotionalFares.ExpireOn; //promotionalFareSector.NoOfPax = promotionalFares.NoOfPax; //promotionalFareSector.BaseFare = (decimal)promotionalFares.BaseFare; //promotionalFareSector.OtherCharges = (decimal)promotionalFares.OtherCharges; //promotionalFareSector.NoOfPax = promotionalFares.NoOfPax; var taxes = promotionalFares.Air_PromotionalFareTaxes; List <PromotionalFareTaxes> promotionalFareTaxesList = new List <PromotionalFareTaxes>(); foreach (var tax in taxes) { PromotionalFareTaxes promotionalFareTaxes = new PromotionalFareTaxes() { PromotionalFareId = tax.PromotionalFareId, PromotionalFareTaxId = tax.PromotionalFareTaxId, TaxName = tax.TaxName, TaxAmount = tax.TaxAmount }; promotionalFareTaxesList.Add(promotionalFareTaxes); } promotionalFareSector.Taxes = promotionalFareTaxesList; var segments = promotionalFares.Air_PromotionalFareSegments; List <PromotionalFareSegment> promotionalFareSegmentList = new List <PromotionalFareSegment>(); foreach (var segment in segments) { PromotionalFareSegment promotionalFareSegment = new PromotionalFareSegment() { //PromotionalFareId = segment.PromotionalFareId, //PromotionalFareSegmentId = segment.PromotionalFareSegmentId, //FromCity = entity.Air_PromotionalFares.Where(x =>x.FromCityId== segment.FromCityId).Select(x=>x.AirlineCities.CityCode).FirstOrDefault(), //ToCity = entity.Air_PromotionalFares.Where(x => x.ToCityId == segment.ToCityId).Select(x => x.AirlineCities1.CityCode).FirstOrDefault(), //FromCityId = segment.FromCityId, //ToCityId = segment.ToCityId, //DepartureDate = segment.DepartureDate, //DepartureTime = segment.DepartureTime, //ArrivalDate = segment.ArrivalDate, //ArrivalTime = segment.ArrivalTime, //FlightNo = segment.FlightNo, //FromCityList=new SelectList( generalProvider.GetAirlineCityList(),"Value","Text",segment.FromCityId), //ToCityList = new SelectList(generalProvider.GetAirlineCityList(), "Value", "Text", segment.ToCityId) }; promotionalFareSegmentList.Add(promotionalFareSegment); } promotionalFareSector.PromotionalFareSegment = promotionalFareSegmentList; } model.PromotionalFareSector = promotionalFareSector; return(model); }