public ActionResult BranchDistributorAgentEdit(int?id)
        {
            _model = _rep.Detail(id, out _res);
            TempData["InfoMessage"] = _res.ActionMessage;
            if (_res.ErrNumber == 0)
            {
                ViewData["AgentBank"] = _agentdetailsprovider.GetAgentBankList(id.Value);

                foreach (var AsociatedProductOfAgent in _model.AgentProductList)
                {
                    ViewData[AsociatedProductOfAgent.ProductName] = new SelectList(_rep.GetAllRolesListonProductWise(AsociatedProductOfAgent.ProductId), "RoleName", "RoleName", "");
                }
                ViewData["Countrylist"]   = new SelectList(_rep.GetCountry(), "CountryId", "CountryName", _rep.GetCountryInfo(_model.NativeCountryId));
                ViewData["AgentZone"]     = new SelectList(_rep.GetZoneList(), "ZoneId", "ZoneName", _model.ZoneId);
                ViewData["AgentDistrict"] = new SelectList(_rep.GetDistrictListbyZoneId(_model.ZoneId), "DistrictId", "DistrictName", _model.DistrictId);
                ViewData["Status"]        = new SelectList(_rep.GetStatus(), "id", "Name");
                ViewData["AgentTypes"]    = new SelectList(_rep.GetAgentType(), "AgentTypeId", "AgentTypeName", _model.AgentTypeId);

                ViewData["Banks"]            = new SelectList(_rep.GetbankInformation(), "BankId", "BankName");
                ViewData["BankBranches"]     = new SelectList(_rep.GetbankBranchInformation(), "BankBranchId", "BranchName");
                ViewData["BankAccountTypes"] = new SelectList(_rep.GetbankAccountType(), "BankAccountTypeId", "AccountTypeName");
                ViewData["TimeZones"]        = new SelectList(_rep.GetTimeZoneList(), "RecordID", "StandardName");
                _model.AgentId = (int)id;


                return(View(_model));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
Exemple #2
0
        public ActionResult Create()
        {
            DistributorManagementModel model = new DistributorManagementModel();

            try
            {
                model.Countries     = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", 0);
                model.StatusOption  = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", 1);
                model.Zones         = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName");
                model.Districts     = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
                model.TimeZones     = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", 66);
                model.BranchOffices = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName");
                return(View(model));
            }
            catch (Exception ex)
            {
                model.Countries            = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", 0);
                model.StatusOption         = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", 1);
                model.Zones                = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName");
                model.Districts            = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
                model.TimeZones            = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", 66);
                model.BranchOffices        = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName");
                TempData["ActionResponse"] = ex.Message;
                return(View(model));
            }
        }
        public ActionResult Create()
        {
            ViewData["Countrylist"]  = new SelectList(_rep.GetCountry(), "CountryId", "CountryName", 0);
            ViewData["Status"]       = new SelectList(_rep.GetStatus(), "id", "Name", 1);
            ViewData["AirlineGroup"] = new SelectList(_rep.GetAirlineGroup(), "AirlineGroupId", "AirlineGroupName");

            AgentModel viewmodel = new AgentModel
            {
                agentsettinglist    = _rep.GetAllSettingList(),
                ProductBaseRoleList = _rep.GetProductList(),
                ReferredByList      = _rep.GetAllGetSalesAgentList(),
                MEsNameList         = _rep.GetAllGetSalesAgentList(),

                // MasterDealNameListOfAirlines = _rep.GetAllDealListOfAirlines(),
                // MasterDealNameListOfHotels=_rep.GetAllDealListOfHotel(),
            };

            /////// TODO : Repalce View data into Strongly Type Model ViewData /////////////
            ViewData["AirlineGroup"] = new SelectList(_rep.GetAirlineGroup(), "AirlineGroupId", "AirlineGroupName");
            ViewData["RoleAssign"]   = new SelectList("", "RoleName", "RoleName", "");
            ViewData["AgentTypes"]   = new SelectList(_rep.GetAgentType(), "AgentTypeId", "AgentTypeName");

            ViewData["AgentZone"]        = new SelectList(_rep.GetZoneList(), "ZoneId", "ZoneName");
            ViewData["AgentDistrict"]    = new SelectList(_rep.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
            ViewData["BankAccountTypes"] = new SelectList(_rep.GetbankAccountType(), "BankAccountTypeId", "AccountTypeName");
            ViewData["TimeZones"]        = new SelectList(_rep.GetTimeZoneList(), "RecordID", "StandardName", 66);
            return(View(viewmodel));
        }
        public ActionResult Create()
        {
            BranchOfficeManagementModel model = new BranchOfficeManagementModel();
            TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"];

            try
            {
                model.NativeCountryList = new SelectList(_repAgManagement.GetCountry(), "CountryId", "CountryName", 0);
                model.StatusList        = new SelectList(_repAgManagement.GetStatus(), "id", "Name", 1);
                model.ZoneList          = new SelectList(_repAgManagement.GetZoneList(), "ZoneId", "ZoneName");
                model.DistrictList      = new SelectList(_repAgManagement.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
                model.TimeZoneList      = new SelectList(_repAgManagement.GetTimeZoneList(), "RecordID", "StandardName", 66);


                model.MasterDealNameListOfAirlines = provider.GetBranchAllDealListOfAirlines();
                model.MasterDealNameListOfHotels   = provider.GetAllDealListOfHotel();
                model.MasterDealNameListOfBus      = provider.GetAllDealListOfBus();
                model.MasterDealNameListOfMobile   = provider.GetAllDealListOfMobile();

                ViewData["branchClass"] = new SelectList(provider.GetBranchClass(), "BranchClassId", "BranchClassName");
                model.BranchClassId     = provider.GeBranchClass(obj.LoginTypeId);
            }
            catch (Exception ex)
            {
                TempData["ActionResponse"] = ex.Message;
            }

            return(View(model));
        }
        public ActionResult Create()
        {
            DistributorManagementModel model = new DistributorManagementModel();
            TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"];

            try
            {
                model.Countries     = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", 0);
                model.StatusOption  = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", 1);
                model.Zones         = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName");
                model.Districts     = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
                model.TimeZones     = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", 66);
                model.BranchOffices = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName");


                model.MasterDealNameListOfAirlines = provider.GetAllBranchDistributorDealListOfAirlines(obj.LoginTypeId);
                model.MasterDealNameListOfHotels   = provider.GetAllBranchDistributorDealListOfHotels(obj.LoginTypeId);
                model.MasterDealNameListOfBus      = provider.GetAllBranchDistributorDealListOfBus(obj.LoginTypeId);
                model.MasterDealNameListOfMobile   = provider.GetAllBranchDistributorDealListOfMobile(obj.LoginTypeId);

                ViewData["distributorClass"] = new SelectList(provider.GetDistributorClass(), "DistributorClassId", "DistributorClassName");
                model.DistributorClassId     = provider.GeDistributorClass(obj.LoginTypeId);

                return(View(model));
            }
            catch (Exception ex)
            {
                model.Countries     = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", 0);
                model.StatusOption  = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", 1);
                model.Zones         = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName");
                model.Districts     = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
                model.TimeZones     = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", 66);
                model.BranchOffices = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName");

                model.MasterDealNameListOfAirlines = provider.GetAllBranchDistributorDealListOfAirlines(obj.LoginTypeId);
                model.MasterDealNameListOfHotels   = provider.GetAllBranchDistributorDealListOfHotels(obj.LoginTypeId);
                model.MasterDealNameListOfBus      = provider.GetAllBranchDistributorDealListOfBus(obj.LoginTypeId);
                model.MasterDealNameListOfMobile   = provider.GetAllBranchDistributorDealListOfMobile(obj.LoginTypeId);

                ViewData["distributorClass"] = new SelectList(provider.GetDistributorClass(), "DistributorClassId", "DistributorClassName");
                model.DistributorClassId     = provider.GeDistributorClass(obj.LoginTypeId);

                TempData["ActionResponse"] = ex.Message;
                return(View(model));
            }
        }
        public DistributorManagementModel GetDistributorsList()
        {
            DistributorManagementModel returnViewModel = new DistributorManagementModel();

            List <DistributorManagementModel> viewModel = new List <DistributorManagementModel>();

            var distributors = entity.Distributors.Where(x => x.isSystem != true);

            foreach (var distributor in distributors)
            {
                DistributorManagementModel model = new DistributorManagementModel()
                {
                    DistributorId     = distributor.DistributorId,
                    BranchOfficeId    = distributor.BranchOfficeId,
                    BranchOfficeName  = distributor.BranchOffices != null ? distributor.BranchOffices.BranchOfficeName + "(" + distributor.BranchOffices.BranchOfficeCode + ")" : string.Empty,
                    DistributorCode   = distributor.DistributorCode,
                    DistributorName   = distributor.DistributorName,
                    NativeCountryId   = distributor.NativeCountryId,
                    NativeCountryName = string.Empty,
                    ZoneId            = distributor.ZoneId,
                    ZoneName          = distributor.Zones != null ? distributor.Zones.ZoneName : string.Empty,
                    DistrictId        = distributor.DistrictId,
                    DistrictName      = distributor.Districts != null ? distributor.Districts.DistrictName : string.Empty,
                    Address           = distributor.Address,
                    Phone             = distributor.Phone,
                    Email             = distributor.Email,
                    FaxNo             = distributor.FaxNo,
                    PanNo             = distributor.PanNo,
                    Web          = distributor.Web,
                    Status       = Convert.ToInt32(distributor.Status),
                    TimeZoneId   = distributor.TimeZoneId,
                    TimeZoneName = string.Empty,
                    isSystem     = distributor.isSystem,
                    CreatedBy    = distributor.CreatedBy,
                    CreatedDate  = distributor.CreatedDate,
                };
                viewModel.Add(model);
            }

            returnViewModel.Distributors = viewModel;
            returnViewModel.StatusOption = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", 1);

            return(returnViewModel);
        }
Exemple #7
0
        public ActionResult Create()
        {
            ViewData["Countrylist"]  = new SelectList(_rep.GetCountry(), "CountryId", "CountryName", 0);
            ViewData["Status"]       = new SelectList(_rep.GetStatus(), "id", "Name", 1);
            ViewData["AirlineGroup"] = new SelectList(_rep.GetAirlineGroup(), "AirlineGroupId", "AirlineGroupName");

            AgentModel viewmodel = new AgentModel
            {
                agentsettinglist    = _rep.GetAllSettingList(),
                ProductBaseRoleList = _rep.GetProductList(),
            };

            ViewData["AirlineGroup"] = new SelectList(_rep.GetAirlineGroup(), "AirlineGroupId", "AirlineGroupName");
            ViewData["RoleAssign"]   = new SelectList("", "RoleName", "RoleName", "");
            ViewData["AgentTypes"]   = new SelectList(_rep.GetAgentType(), "AgentTypeId", "AgentTypeName");

            ViewData["AgentZone"]        = new SelectList(_rep.GetZoneList(), "ZoneId", "ZoneName");
            ViewData["AgentDistrict"]    = new SelectList(_rep.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName");
            ViewData["BankAccountTypes"] = new SelectList(_rep.GetbankAccountType(), "BankAccountTypeId", "AccountTypeName");
            ViewData["TimeZones"]        = new SelectList(_rep.GetTimeZoneList(), "RecordID", "StandardName", 66);
            return(View(viewmodel));
        }