예제 #1
0
        public async Task <IActionResult> GetManageCompanies(ManageCompanyViewModel model)
        {
            Config config = await _appDb.GetConfigAsync();

            List <ManageCompany> manageCompanies = await _appDb.GetManageCompaniesAsync();

            List <int> manageCompanyStatuses = new List <int>();
            List <int> manageCompanyTypes    = new List <int>();

            foreach (var key in Request.Form["ManageCompanyStatuses"])
            {
                manageCompanyStatuses.Add(int.Parse(key));
            }
            foreach (var key in Request.Form["ManageCompanyTypes"])
            {
                manageCompanyTypes.Add(int.Parse(key));
            }
            model.ManageCompanyStatusIds = manageCompanyStatuses;
            model.ManageCompanyTypeIds   = manageCompanyTypes;
            model.ManageCompanyStatuses  = ManageAccess.GetCompanyStatuses(config);
            model.ManageCompanyTypes     = ManageAccess.GetCompanyTypes(config);

            string manageCompanyFilterUrl = ManageAccess.CreateCompanyFilterUrl(manageCompanyStatuses, manageCompanyTypes);

            ViewBag.ManageCompanies = ManageAccess.GetCompanies(config, manageCompanyFilterUrl);

            return(View(model));
        }
예제 #2
0
        public ManageCompanyPage(ManageCompanyViewModel viewModel)
        {
            InitializeComponent();
            BindingContext = _viewModel = viewModel;

            setPermImage();
            setPermText();
        }
예제 #3
0
        public async Task <IActionResult> GetManageCompanies()
        {
            List <ManageCompany> manageCompanies = new List <ManageCompany>();
            Config config = await _appDb.GetConfigAsync();

            if (ViewBag.ManageCompanies == null)
            {
                manageCompanies = await _appDb.GetManageCompaniesAsync();
            }
            else
            {
                manageCompanies = ViewBag.ManageCompanies;
            }

            ManageCompanyViewModel manageCompanyViewModel = new ManageCompanyViewModel();

            manageCompanyViewModel.ManageCompanies       = manageCompanies;
            manageCompanyViewModel.ManageCompanyStatuses = ManageAccess.GetCompanyStatuses(config);
            manageCompanyViewModel.ManageCompanyTypes    = ManageAccess.GetCompanyTypes(config);


            return(View(manageCompanyViewModel));
        }