public ActionResult AgentList(int id, int?page, string name)
        {
            //AgentManagementRepository agentManagementRepository = new AgentManagementRepository();
            //var model = agentManagementRepository.GetAllAgentByPaging().Where(x => x.BranchOfficeId == id).ToList();
            //if (model.Count > 0)
            //    model[0].AgentStatus = true;
            //return PartialView(@"~\Areas\Administrator\Views\DistributorManagement\VUC_AgentList.ascx", model);

            int currentPageIndex = page.HasValue ? page.Value : 1;
            int defaultPageSize  = 50;

            DistributorManagementProvider   distributorManagementProvider = new DistributorManagementProvider();
            DistributorAgentManagementModel model = new DistributorAgentManagementModel();

            if (name != "Distributor")
            {
                model.AgentsList = distributorManagementProvider.AgentsListByBranchOfficeId().Where(x => x.BranchOfficeId == id).ToPagedList(currentPageIndex, defaultPageSize);
            }
            else
            {
                model.AgentsList = distributorManagementProvider.AgentsListByBranchOfficeId().Where(x => x.DistributorId == id).ToPagedList(currentPageIndex, defaultPageSize);
            }
            if (model.AgentsList.Count > 0)
            {
                model.AgentStatus = true;
            }
            model.RedirectedFrom = "BranchOfficeManagement";
            model.BranchOfficeId = id;

            return(View(model));
        }
예제 #2
0
        // ***********************************************************************************
        ////// Setting of session For Specific user login
        // ***********************************************************************************
        public void SetSessionsObject(Guid userId)
        {
            Agents        ainfo = null;
            TravelSession obj   = new TravelSession();
            aspnet_Users  tu    = GetUserInfo(userId);

            try
            {
                ainfo = GetAgentInfo(tu.UserId);
            }
            catch (Exception)
            {
            }

            UsersDetails udinfo = GetUserDetailsInfo(userId);

            if (udinfo.UserTypeId == 5)
            {
                BranchOfficeManagementProvider branchOfficeManagementProvider = new BranchOfficeManagementProvider();
                View_BranchDetails             branchOffices = branchOfficeManagementProvider.GetBranchOfficeByUserId(userId);

                obj.LoginTypeName = branchOffices.BranchOfficeName;
                obj.AgentCode     = branchOffices.BranchOfficeName;
                obj.LoginTypeId   = branchOffices.BranchOfficeId;
            }
            else if (udinfo.UserTypeId == 6)
            {
                DistributorManagementProvider distributorManagementProvider = new DistributorManagementProvider();
                View_DistributorDetails       distributors = distributorManagementProvider.GetDistributorByUserId(userId);

                obj.LoginTypeName = distributors.DistributorName;
                obj.AgentCode     = distributors.DistributorName;
                obj.LoginTypeId   = distributors.DistributorId;
            }
            else if (udinfo.UserTypeId == 7)
            {
                obj.Id         = userId;
                obj.LoginName  = tu.UserName;
                obj.AppUserId  = udinfo.AppUserId;
                obj.UserTypeId = udinfo.UserTypeId;
                obj.ProductId  = GetUserProductId(obj.AppUserId);
            }

            obj.Id         = userId;
            obj.LoginName  = tu.UserName;
            obj.AppUserId  = udinfo.AppUserId;
            obj.UserTypeId = udinfo.UserTypeId;
            obj.ProductId  = GetUserProductId(obj.AppUserId);

            HttpContext.Current.Session["TravelPortalSessionInfo"] = obj;
        }
        public ActionResult AgentList(int id, int?page)
        {
            int currentPageIndex = page.HasValue ? page.Value : 1;
            int defaultPageSize  = 50;

            DistributorManagementProvider   distributorManagementProvider = new DistributorManagementProvider();
            DistributorAgentManagementModel model = new DistributorAgentManagementModel();

            model.AgentsList = distributorManagementProvider.AgentsListByBranchOfficeId().Where(x => x.DistributorId == id).ToPagedList(currentPageIndex, defaultPageSize);
            if (model.AgentsList.Count > 0)
            {
                model.AgentStatus = true;
            }
            model.DistributorId = id;
            return(View(model));
        }
        public ActionResult DistributorList(int id, int?page)
        {
            //DistributorManagementProvider distributorManagementProvider = new DistributorManagementProvider();
            //IEnumerable<DistributorManagementModel> Distributors = distributorManagementProvider.GetBranchDistributorsByBranchOfficeId(id).Distributors;
            //return PartialView("VUC_DistributorList", Distributors);

            int currentPageIndex = page.HasValue ? page.Value : 1;
            int defaultPageSize  = 50;

            DistributorManagementProvider distributorManagementProvider = new DistributorManagementProvider();
            DistributorManagementModel    model = new DistributorManagementModel();

            model.DistributorsList = distributorManagementProvider.BranchDistributorsByBranchOfficeId(id).ToPagedList(currentPageIndex, defaultPageSize);
            model.DistributorId    = id;
            return(View(model));
        }