// GET: View A TransactionFeeClientFeeGroup
        public ActionResult View(int cid, int tid)
        {
            //Get Item From Database
            TransactionFeeClientFeeGroup transactionFeeClientFeeGroup = new TransactionFeeClientFeeGroup();

            transactionFeeClientFeeGroup = transactionFeeClientFeeGroupRepository.GetItem(cid, tid);

            //Check Exists
            if (transactionFeeClientFeeGroup == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return(View("RecordDoesNotExistError"));
            }

            ClientFeeGroupTransactionFeeAirVM clientFeeGroupTransactionFeeAirVM = new ClientFeeGroupTransactionFeeAirVM();

            ClientFeeGroup clientFeeGroup = new ClientFeeGroup();

            clientFeeGroup = clientFeeGroupRepository.GetGroup(cid);
            clientFeeGroupTransactionFeeAirVM.ClientFeeGroup = clientFeeGroup;

            TransactionFeeAir transactionFeeAir = new TransactionFeeAir();

            transactionFeeAir = transactionFeeAirRepository.GetItem(tid);
            transactionFeeAirRepository.EditForDisplay(transactionFeeAir);
            clientFeeGroupTransactionFeeAirVM.TransactionFeeAir = transactionFeeAir;

            PolicyRouting policyRouting = new PolicyRouting();

            policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFeeAir.PolicyRoutingId);
            policyRoutingRepository.EditForDisplay(policyRouting);
            clientFeeGroupTransactionFeeAirVM.PolicyRouting = policyRouting;

            return(View(clientFeeGroupTransactionFeeAirVM));
        }
Esempio n. 2
0
 public TransactionFeeAirVM(TransactionFeeAir transactionFee, PolicyRouting policyRouting,
                            IEnumerable <SelectListItem> travelIndicators,
                            IEnumerable <SelectListItem> bookingSources,
                            IEnumerable <SelectListItem> bookingOriginations,
                            IEnumerable <SelectListItem> chargeTypes,
                            IEnumerable <SelectListItem> transactionTypes,
                            IEnumerable <SelectListItem> feeCategories,
                            IEnumerable <SelectListItem> travelerBackOfficeTypes,
                            IEnumerable <SelectListItem> tripTypeClassifications,
                            IEnumerable <SelectListItem> ticketPriceCurrencies,
                            IEnumerable <SelectListItem> feeCurrencies
                            )
 {
     TransactionFee          = transactionFee;
     PolicyRouting           = policyRouting;
     TravelIndicators        = travelIndicators;
     BookingSources          = bookingSources;
     ChargeTypes             = chargeTypes;
     BookingOriginations     = bookingOriginations;
     TransactionTypes        = transactionTypes;
     FeeCategories           = feeCategories;
     TravelerBackOfficeTypes = travelerBackOfficeTypes;
     TripTypeClassifications = tripTypeClassifications;
     TicketPriceCurrencies   = ticketPriceCurrencies;
     FeeCurrencies           = feeCurrencies;
 }
Esempio n. 3
0
		public ActionResult Delete(int id)
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return View("Error");
            }

            //Get Item From Database
            TransactionFeeAir transactionFee = new TransactionFeeAir();
            transactionFee = transactionFeeAirRepository.GetItem(id);

            //Check Exists
            if (transactionFee == null)
            {
                ViewData["ActionMethod"] = "DeleteGet";
                return View("RecordDoesNotExistError");
            }

            TransactionFeeAirVM transactionFeeAirVM = new TransactionFeeAirVM();
            transactionFeeAirRepository.EditForDisplay(transactionFee);
            transactionFeeAirVM.TransactionFee = transactionFee;

            PolicyRouting policyRouting = new PolicyRouting();
            if (transactionFee.PolicyRoutingId != null)
            {
                policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFee.PolicyRoutingId);
                policyRoutingRepository.EditPolicyRouting(policyRouting);
            }
            transactionFeeAirVM.PolicyRouting = policyRouting;

            return View(transactionFeeAirVM);
        }
Esempio n. 4
0
        // GET: View A Single TransactionFeeAir
        public ActionResult View(int id)
        {
            //Get Item From Database
            TransactionFeeAir transactionFee = new TransactionFeeAir();
            transactionFee = transactionFeeAirRepository.GetItem(id);

            //Check Exists
            if (transactionFee == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return View("RecordDoesNotExistError");
            }

            TransactionFeeAirVM transactionFeeAirVM = new TransactionFeeAirVM();
            transactionFeeAirRepository.EditForDisplay(transactionFee);
            transactionFeeAirVM.TransactionFee = transactionFee;

            PolicyRouting policyRouting = new PolicyRouting();
            if (transactionFee.PolicyRoutingId != null)
            {
                policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFee.PolicyRoutingId);
                policyRoutingRepository.EditPolicyRouting(policyRouting);
            }
           
            transactionFeeAirVM.PolicyRouting = policyRouting;

            return View(transactionFeeAirVM);
        }
Esempio n. 5
0
        //Where Used: TransactionFeeClientFeeGroup
        public TransactionFeeVM IsTransactionFeeAir(int transactionFeeId)
        {
            HierarchyDC db = new HierarchyDC(Settings.getConnectionString());

            TransactionFeeAir transactionFeeAir = new TransactionFeeAir();
            PolicyRouting     policyRouting     = new PolicyRouting();

            TransactionFeeAirRepository transactionFeeAirRepository = new TransactionFeeAirRepository();

            transactionFeeAir = transactionFeeAirRepository.GetItem(transactionFeeId);

            PolicyRoutingRepository policyRoutingRepository = new PolicyRoutingRepository();

            policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFeeAir.PolicyRoutingId);
            policyRoutingRepository.EditPolicyRouting(policyRouting);

            TransactionFeeVM transactionFeeVM = new TransactionFeeVM();

            transactionFeeVM.TransactionFee       = transactionFeeAir;
            transactionFeeVM.Name                 = policyRouting.Name;
            transactionFeeVM.FromGlobalFlag       = policyRouting.FromGlobalFlag;
            transactionFeeVM.FromCode             = policyRouting.FromCode;
            transactionFeeVM.ToGlobalFlag         = policyRouting.ToGlobalFlag;
            transactionFeeVM.ToCode               = policyRouting.ToCode;
            transactionFeeVM.RoutingViceVersaFlag = policyRouting.RoutingViceVersaFlag;
            return(transactionFeeVM);

            /* var result = (from n in db.spDesktopDataAdmin_SelectTransactionFeeAir_v1(transactionFeeId)
             *             select
             *            new TransactionFeeAir
             *                 {
             *                     TransactionFeeId = n.TransactionFeeId,
             *                     ProductName = n.ProductName,
             *                     TransactionFeeDescription = n.TransactionFeeDescription,
             *                     TravelIndicatorDescription = n.TravelIndicatorDescription,
             *                     BookingSourceDescription = n.BookingSourceDescription,
             *                     BookingOriginationDescription = n.BookingOriginationDescription,
             *                     ChargeTypeDescription = n.ChargeTypeDescription,
             *                     TransactionTypeCode = n.TransactionTypeCode,
             *                     FeeCategory = n.FeeCategory,
             *                     TravelerClassCode = n.TravelerClassCode,
             *                     SupplierName = n.SupplierName,
             *                     MinimumFeeCategoryQuantity = n.MinimumFeeCategoryQuantity,
             *                     MaximumFeeCategoryQuantity = n.MaximumFeeCategoryQuantity,
             *                     MinimumTicketPrice = n.MinimumTicketPrice,
             *                     MaximumTicketPrice = n.MaximumTicketPrice,
             *                     TicketPriceCurrencyCode = n.TicketPriceCurrencyCode,
             *                     IncursGSTFlag = n.IncursGSTFlag,
             *                     TripTypeClassificationDescription = n.TripTypeClassificationDescription,
             *                     EnabledDate = n.EnabledDate,
             *                     ExpiryDate = n.ExpiryDate,
             *                     FeeAmount = n.FeeAmount,
             *                     FeePercent = n.FeePercent,
             *                     FeeCurrencyCode = n.FeeCurrencyCode,
             *                     PolicyRoutingId = n.PolicyRoutingId
             *                 }).FirstOrDefault();
             * return result;*/
        }
Esempio n. 6
0
        // GET: Create A Single ClientFee
        public ActionResult Create()
        {
            int productId = 1;

            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return View("Error");
            }

            ProductRepository productRepository = new ProductRepository();
            Product product = new Product();
            product = productRepository.GetProduct(productId);

            TransactionFeeAirVM transactionFeeVM = new TransactionFeeAirVM();
            TransactionFeeAir transactionFee = new TransactionFeeAir();
            transactionFee.ProductName = product.ProductName;
            transactionFee.ProductId = product.ProductId;
            transactionFee.IncursGSTFlagNonNullable = false;
            transactionFeeVM.TransactionFee = transactionFee;

            TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository();
            transactionFeeVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription");

            BookingSourceRepository bookingSourceRepository = new BookingSourceRepository();
            transactionFeeVM.BookingSources = new SelectList(bookingSourceRepository.GetAllBookingSources().ToList(), "BookingSourceCode", "BookingSourceCode");

            BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository();
            transactionFeeVM.BookingOriginations = new SelectList(bookingOriginationRepository.GetAllBookingOriginations().ToList(), "BookingOriginationCode", "BookingOriginationCode");

            ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository();
            transactionFeeVM.ChargeTypes = new SelectList(chargeTypeRepository.GetAllChargeTypes().ToList(), "ChargeTypeCode", "ChargeTypeDescription");

            TransactionTypeRepository transactionTypeRepository = new TransactionTypeRepository();
            transactionFeeVM.TransactionTypes = new SelectList(transactionTypeRepository.GetAllTransactionTypes().ToList(), "TransactionTypeCode", "TransactionTypeCode");

            FeeCategoryRepository feeCategoryRepository = new FeeCategoryRepository();
            transactionFeeVM.FeeCategories = new SelectList(feeCategoryRepository.GetAllFeeCategories().ToList(), "FeeCategory1", "FeeCategory1");

            TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository();
            transactionFeeVM.TravelerBackOfficeTypes = new SelectList(travelerBackOfficeTypeRepository.GetAllTravelerBackOfficeTypes().ToList(), "TravelerBackOfficeTypeCode", "TravelerBackOfficeTypeDescription");

            TripTypeClassificationRepository tripTypeClassificationRepository = new TripTypeClassificationRepository();
            transactionFeeVM.TripTypeClassifications = new SelectList(tripTypeClassificationRepository.GetAllTripTypeClassifications().ToList(), "TripTypeClassificationId", "TripTypeClassificationDescription");
           
            CurrencyRepository currencyRepository = new CurrencyRepository();
            transactionFeeVM.TicketPriceCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");
            transactionFeeVM.FeeCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            PolicyRouting policyRouting = new PolicyRouting();
            policyRouting.FromGlobalFlag = false;
            policyRouting.ToGlobalFlag = false;
            transactionFeeVM.PolicyRouting = policyRouting;

            return View(transactionFeeVM);
        }
Esempio n. 7
0
 public ClientFeeGroupTransactionFeeAirVM(TransactionFeeClientFeeGroup transactionFeeClientFeeGroup, ClientFeeGroup clientFeeGroup, TransactionFeeAir transactionFeeAir, PolicyRouting policyRouting, int feeTypeId, string feeTypeDisplayName, string feeTypeDisplayNameShort)
 {
     TransactionFeeClientFeeGroup = transactionFeeClientFeeGroup;
     ClientFeeGroup          = clientFeeGroup;
     TransactionFeeAir       = transactionFeeAir;
     PolicyRouting           = policyRouting;
     FeeTypeId               = feeTypeId;
     FeeTypeDisplayName      = feeTypeDisplayName;
     FeeTypeDisplayNameShort = feeTypeDisplayNameShort;
 }
        //Delete From DB
        public void Delete(TransactionFeeAir transactionFee)
        {
            string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0];

            db.spDesktopDataAdmin_DeleteTransactionFeeAir_v1(
                transactionFee.TransactionFeeId,
                adminUserGuid,
                transactionFee.VersionNumber
                );
        }
Esempio n. 9
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return View("Error");
            }

            //Get Item From Database
            TransactionFeeAir transactionFee = new TransactionFeeAir();
            transactionFee = transactionFeeAirRepository.GetItem(id);

            //Check Exists
            if (transactionFee == null)
            {
                ViewData["ActionMethod"] = "DeletePost";
                return View("RecordDoesNotExistError");
            }

            //Delete Item
            try
            {
                transactionFee.VersionNumber = Int32.Parse(collection["TransactionFee.VersionNumber"]);
                transactionFeeAirRepository.Delete(transactionFee);
            }
            catch (SqlException ex)
            {
                //Versioning Error - go to standard versionError page
                if (ex.Message == "SQLVersioningError")
                {
                    ViewData["ReturnURL"] = "/TransactionFeeAir.mvc/Delete/" + transactionFee.TransactionFeeId.ToString();
                    return View("VersionError");
                }
                //Restraint Error - go to standard DeleteError page
                if (ex.Message == "SQLDeleteError")
                {
                    ViewData["ReturnURL"] = "/TransactionFeeAir.mvc/Delete/" + transactionFee.TransactionFeeId.ToString();
                    return View("DeleteError");
                }
				
				LogRepository logRepository = new LogRepository();
				logRepository.LogError(ex.Message);

                //Generic Error
                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return View("Error");
            }

            //Return
            return RedirectToAction("List", "TransactionFee");
        }
        //Add to DB
        public void Update(TransactionFeeAir transactionFee, PolicyRouting policyRouting)
        {
            string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0];

            db.spDesktopDataAdmin_UpdateTransactionFeeAir_v1(
                transactionFee.TransactionFeeId,
                transactionFee.TransactionFeeDescription,
                transactionFee.TravelIndicator,
                transactionFee.BookingSourceCode,
                transactionFee.BookingOriginationCode,
                transactionFee.ChargeTypeCode,
                transactionFee.TransactionTypeCode,
                transactionFee.FeeCategory,
                transactionFee.TravelerClassCode,
                transactionFee.SupplierCode,
                transactionFee.MinimumFeeCategoryQuantity,
                transactionFee.MaximumFeeCategoryQuantity,
                transactionFee.MinimumTicketPrice,
                transactionFee.MaximumTicketPrice,
                transactionFee.TicketPriceCurrencyCode,
                transactionFee.TripTypeClassificationId,
                transactionFee.TemplateFeeFlag,
                transactionFee.EnabledDate,
                transactionFee.ExpiryDate,
                transactionFee.IncursGSTFlagNonNullable,
                transactionFee.FeeAmount,
                transactionFee.FeeCurrencyCode,
                transactionFee.FeePercent,
                policyRouting.Name,
                policyRouting.FromGlobalFlag,
                policyRouting.FromGlobalRegionCode,
                policyRouting.FromGlobalSubRegionCode,
                policyRouting.FromCountryCode,
                policyRouting.FromCityCode,
                policyRouting.FromTravelPortCode,
                policyRouting.FromTraverlPortTypeId,
                policyRouting.ToGlobalFlag,
                policyRouting.ToGlobalRegionCode,
                policyRouting.ToGlobalSubRegionCode,
                policyRouting.ToCountryCode,
                policyRouting.ToCityCode,
                policyRouting.ToTravelPortCode,
                policyRouting.ToTravelPortTypeId,
                policyRouting.RoutingViceVersaFlag,
                adminUserGuid,
                transactionFee.VersionNumber
                );
        }
Esempio n. 11
0
        public ActionResult Create(TransactionFeeAirVM transactionFeeAirVM)
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return View("Error");
            }


            //Get PolicyRouting Info
            PolicyRouting policyRouting = new PolicyRouting();
            policyRouting = transactionFeeAirVM.PolicyRouting;

            //Get TransactionFee Info
            TransactionFeeAir transactionFee = new TransactionFeeAir();
            transactionFee = transactionFeeAirVM.TransactionFee;

            //Edit Routing
            policyRoutingRepository.EditPolicyRouting(policyRouting);

            //Database Update
            try
            {
                transactionFeeAirRepository.Add(transactionFee, policyRouting);
            }
            catch (SqlException ex)
            {
                //Non-Unique Name
                if (ex.Message == "NonUniqueName")
                {
                    return View("NonUniqueNameError");
                }
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return View("Error");
            }

            return RedirectToAction("List", "TransactionFee");
        }
        public void EditForDisplay(TransactionFeeAir transactionFee)
        {
            TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository();
            TravelIndicator           travelIndicator           = new TravelIndicator();

            travelIndicator = travelIndicatorRepository.GetTravelIndicator(transactionFee.TravelIndicator);
            if (travelIndicator != null)
            {
                transactionFee.TravelIndicatorDescription = travelIndicator.TravelIndicatorDescription;
            }

            CurrencyRepository currencyRepository = new CurrencyRepository();
            Currency           currency           = new Currency();

            currency = currencyRepository.GetCurrency(transactionFee.FeeCurrencyCode);
            if (currency != null)
            {
                transactionFee.FeeCurrencyName = currency.Name;
            }
            currency = currencyRepository.GetCurrency(transactionFee.TicketPriceCurrencyCode);
            if (currency != null)
            {
                transactionFee.TicketPriceCurrencyName = currency.Name;
            }


            BookingSourceRepository bookingSourceRepository = new BookingSourceRepository();
            BookingSource           bookingSource           = new BookingSource();

            bookingSource = bookingSourceRepository.GetBookingSource(transactionFee.BookingSourceCode);
            if (bookingSource != null)
            {
                transactionFee.BookingSourceDescription = bookingSource.BookingSourceDescription;
            }

            BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository();
            BookingOrigination           bookingOrigination           = new BookingOrigination();

            bookingOrigination = bookingOriginationRepository.GetBookingOrigination(transactionFee.BookingOriginationCode);
            if (bookingOrigination != null)
            {
                transactionFee.BookingOriginationCode = bookingOrigination.BookingOriginationCode;
            }

            ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository();
            ChargeType           chargeType           = new ChargeType();

            chargeType = chargeTypeRepository.GetChargeType(transactionFee.ChargeTypeCode);
            if (bookingOrigination != null)
            {
                transactionFee.ChargeTypeDescription = chargeType.ChargeTypeDescription;
            }

            TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository();
            TravelerBackOfficeType           travelerBackOfficeType           = new TravelerBackOfficeType();

            travelerBackOfficeType = travelerBackOfficeTypeRepository.GetTravelerBackOfficeType(transactionFee.TravelerClassCode);
            if (travelerBackOfficeType != null)
            {
                transactionFee.TravelerBackOfficeTypeDescription = travelerBackOfficeType.TravelerBackOfficeTypeDescription;
            }

            if (transactionFee.ProductId != null)
            {
                ProductRepository productRepository = new ProductRepository();
                Product           product           = new Product();
                product = productRepository.GetProduct((int)transactionFee.ProductId);
                if (product != null)
                {
                    //Supplier
                    if (!String.IsNullOrEmpty(transactionFee.SupplierCode))
                    {
                        SupplierRepository supplierRepository = new SupplierRepository();
                        Supplier           supplier           = new Supplier();
                        supplier = supplierRepository.GetSupplier(transactionFee.SupplierCode, (int)transactionFee.ProductId);
                        if (supplier != null)
                        {
                            transactionFee.SupplierName = supplier.SupplierName;
                        }
                    }
                }
            }

            if (transactionFee.PolicyLocationId != null)
            {
                PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository();
                PolicyLocation           policyLocation           = new PolicyLocation();
                policyLocation = policyLocationRepository.GetPolicyLocation((int)transactionFee.PolicyLocationId);
                if (policyLocation != null)
                {
                    transactionFee.PolicyLocationName = policyLocation.PolicyLocationName;
                }
            }

            //IncursGSTFlag is nullable
            if (transactionFee.IncursGSTFlag != true)
            {
                transactionFee.IncursGSTFlag = false;
            }
            transactionFee.IncursGSTFlagNonNullable = (bool)transactionFee.IncursGSTFlag;
        }
Esempio n. 13
0
        public ActionResult Edit(TransactionFeeAirVM transactionFeeAirVM)
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return View("Error");
            }

            TransactionFeeAir transactionFee = new TransactionFeeAir();
            transactionFee = transactionFeeAirRepository.GetItem(transactionFeeAirVM.TransactionFee.TransactionFeeId);

            PolicyRouting policyRouting = new PolicyRouting();
            policyRouting = transactionFeeAirVM.PolicyRouting;

            //Check Exists
            if (transactionFee == null || policyRouting == null)
            {
                ViewData["ActionMethod"] = "EditPost";
                return View("RecordDoesNotExistError");
            }

            //Update  Model from Form
            try
            {
                UpdateModel(transactionFee, "TransactionFee");
                UpdateModel(policyRouting, "PolicyRouting");
            }
            catch
            {
                string n = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        n += error.ErrorMessage;
                    }
                }
                ViewData["Message"] = "ValidationError : " + n;
                return View("Error");
            }

            //add the PolicyRouting information
            //PolicyRouting policyRouting = new PolicyRouting();
            //policyRouting = transactionFeeAirVM.PolicyRouting;
            /*
            policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFee.PolicyRoutingId);
            try
            {
                UpdateModel(policyRouting, "PolicyRouting");
            }
            catch
            {
                string n = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        n += error.ErrorMessage;
                    }
                }
                ViewData["Message"] = "ValidationError : " + n;
                return View("Error");

            }
            */
            //Edit Routing
            policyRoutingRepository.EditPolicyRouting(policyRouting);

            //Database Update
            try
            {
                transactionFeeAirRepository.Update(transactionFee, policyRouting);
            }
            catch (SqlException ex)
            {
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return View("Error");
            }

            return RedirectToAction("List", "TransactionFee");
        }
Esempio n. 14
0
        // GET: Create TransactionFeeAir
        public ActionResult Edit(int id)
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return View("Error");
            }

            TransactionFeeAir transactionFeeAir = new TransactionFeeAir();
            transactionFeeAir = transactionFeeAirRepository.GetItem(id);
            if (transactionFeeAir == null || transactionFeeAir.ProductId != 1)
            {
                ViewData["ActionMethod"] = "EditAirGet";
                return View("RecordDoesNotExistError");
            }

			transactionFeeAir.IncursGSTFlagNonNullable = ((bool)transactionFeeAir.IncursGSTFlag == true) ? true : false;

            TransactionFeeAirVM transactionFeeVM = new TransactionFeeAirVM();
            transactionFeeVM.TransactionFee = transactionFeeAir;

            TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository();
            transactionFeeVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription");

            BookingSourceRepository bookingSourceRepository = new BookingSourceRepository();
            transactionFeeVM.BookingSources = new SelectList(bookingSourceRepository.GetAllBookingSources().ToList(), "BookingSourceCode", "BookingSourceCode");

            BookingOriginationRepository bookingOriginationRepository = new BookingOriginationRepository();
            transactionFeeVM.BookingOriginations = new SelectList(bookingOriginationRepository.GetAllBookingOriginations().ToList(), "BookingOriginationCode", "BookingOriginationCode");

            ChargeTypeRepository chargeTypeRepository = new ChargeTypeRepository();
            transactionFeeVM.ChargeTypes = new SelectList(chargeTypeRepository.GetAllChargeTypes().ToList(), "ChargeTypeCode", "ChargeTypeDescription");

            TransactionTypeRepository transactionTypeRepository = new TransactionTypeRepository();
            transactionFeeVM.TransactionTypes = new SelectList(transactionTypeRepository.GetAllTransactionTypes().ToList(), "TransactionTypeCode", "TransactionTypeCode");

            FeeCategoryRepository feeCategoryRepository = new FeeCategoryRepository();
            transactionFeeVM.FeeCategories = new SelectList(feeCategoryRepository.GetAllFeeCategories().ToList(), "FeeCategory1", "FeeCategory1");

            TravelerBackOfficeTypeRepository travelerBackOfficeTypeRepository = new TravelerBackOfficeTypeRepository();
            transactionFeeVM.TravelerBackOfficeTypes = new SelectList(travelerBackOfficeTypeRepository.GetAllTravelerBackOfficeTypes().ToList(), "TravelerBackOfficeTypeCode", "TravelerBackOfficeTypeDescription");

            TripTypeClassificationRepository tripTypeClassificationRepository = new TripTypeClassificationRepository();
            transactionFeeVM.TripTypeClassifications = new SelectList(tripTypeClassificationRepository.GetAllTripTypeClassifications().ToList(), "TripTypeClassificationId", "TripTypeClassificationDescription");

            CurrencyRepository currencyRepository = new CurrencyRepository();
            transactionFeeVM.TicketPriceCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");
            transactionFeeVM.FeeCurrencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name");

            PolicyRouting policyRouting = new PolicyRouting();
            if (transactionFeeAir.PolicyRoutingId != null)
            {
                policyRouting = policyRoutingRepository.GetPolicyRouting((int)transactionFeeAir.PolicyRoutingId);
                policyRoutingRepository.EditPolicyRouting(policyRouting);
            }
            //
            transactionFeeVM.PolicyRouting = policyRouting;

            return View(transactionFeeVM);
        }