Beispiel #1
0
        public ActionResult Index()
        {
            AgentClassDealModel model = new AgentClassDealModel();

            model.AgentClassList = ser.GetAllBranchClassList();
            return(View(model));
        }
        public ActionResult Index()
        {
            AgentClassDealModel model = new AgentClassDealModel();
            TravelSession       obj   = null;

            if (Session["TravelPortalSessionInfo"] != null)
            {
                obj = (TravelSession)Session["TravelPortalSessionInfo"];
            }

            model.AgentClassList = ser.GetAllDistributorAgentClassList(obj.LoginTypeId);
            return(View(model));
        }
        public IEnumerable <AgentClassDealModel> GetAllDistributorAgentClassList(int distributorID)
        {
            ATLTravelPortal.Areas.Airline.Repository.MasterDealProvider mDealProvider = new ATLTravelPortal.Areas.Airline.Repository.MasterDealProvider();

            List <AgentClassDealModel> model = new List <AgentClassDealModel>();
            var result = ent.AgentClasses;

            foreach (var item in result)
            {
                AgentClassDealModel obj = new AgentClassDealModel();

                obj.AgentClassId = item.AgentClassId;

                IList <AgentClassDeals> dealIds = GetMasterDealIdbyDistributorClassId(item.AgentClassId, distributorID);
                foreach (var x in dealIds)
                {
                    int productId = GetProductIdByDistributorMasterDealId(x.DealMasterId);
                    if (productId == 1)
                    {
                        obj.DealMasterId = x.DealMasterId;
                    }
                    else if (productId == 2)
                    {
                        obj.HotelMasterDealId = x.DealMasterId;
                    }
                    else if (productId == 3)
                    {
                        obj.MobileMasterDealId = x.DealMasterId;
                    }
                    else if (productId == 4)
                    {
                        obj.BusMasterDealId = x.DealMasterId;
                    }
                }
                obj.AgentClassName   = item.AgentClassName;
                obj.ClassDescription = item.ClassDescription;

                obj.AirlineDealList = mDealProvider.GetAllDealMasterForDistributorAgentClassList(1, distributorID);
                obj.HotelDealList   = mDealProvider.GetAllDealMasterForDistributorAgentClassList(2, distributorID);
                obj.BusDealList     = mDealProvider.GetAllDealMasterForDistributorAgentClassList(4, distributorID);
                obj.MobileDealList  = mDealProvider.GetAllDealMasterForDistributorAgentClassList(3, distributorID);

                model.Add(obj);
            }
            return(model.AsEnumerable());
        }