public async Task <List <CompanyItem> > Search(CompanyListViewModel model) { List <CompanyItem> companyItems = new List <CompanyItem>(); if (!string.IsNullOrWhiteSpace(model.SearchTerm)) { HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("Username", apiKeyUsername); client.DefaultRequestHeaders.Add("Password", apiKeyPassword); var response = await client.GetStringAsync($"{apiBaseUrl}/api/company?searchTerm={model.SearchTerm}"); CompanyViewModel companyViewModel = JsonConvert.DeserializeObject <CompanyViewModel>(response); companyItems = companyViewModel.Companies; } else { companyItems = model.Companies; } return(companyItems); }
public AddCompanyView(CompanyListViewModel companyListViewModel, CompanyService companyService) : this() { _companyListViewModel = companyListViewModel; _companyService = companyService; _companyToAdd = new AddCompanyViewModel(_companyService); DataContext = _companyToAdd; }
public IActionResult Index() { CompanyListViewModel companyListViewModel = new CompanyListViewModel(); companyListViewModel.Companies = companyRepository.GetAll; return(View(companyListViewModel)); }
public IActionResult Index() { CompanyListViewModel comanyListViewModel = new CompanyListViewModel(); comanyListViewModel.Companies = companyRepository.GetAll.OrderBy(c => c.CompanyName); return(View(comanyListViewModel)); }
public IActionResult Detail(int Id) { CompanyListViewModel companyListViewModel = new CompanyListViewModel(); companyListViewModel.Company = _companyRepository.GetById(Id); companyListViewModel.Overview = _companyRepository.GetOverViewById(Id); return(View(companyListViewModel)); }
public CompanyListViewModel Build() { var companies = _service.GetAllCompanies(); var model = new CompanyListViewModel { Companies = companies.SelectToList(BuildCompanyModel) }; return(model); }
public IActionResult Edit(int Id) { CompanyListViewModel companyListViewModel = new CompanyListViewModel(); companyListViewModel.Company = _companyRepository.GetById(Id); if (companyListViewModel.Company == null) { return(NotFound()); } companyListViewModel.Overview = _companyRepository.GetOverViewById(Id); return(View(companyListViewModel)); }
protected override async Task OnInitializedAsync() { try { CompanyModel = await CompanyListService.GetCompanies(); } catch (Exception ex) { CompanyModel.IsError = true; CompanyModel.ErrorMessage = ex.Message; } }
public CompanyListViewModel GetCompanyList() { var companies = this.companiesRepository .All() .OrderByDescending(c => c.CreatedOn) .To <CompanyViewModel>() .ToList(); var companyListViewModel = new CompanyListViewModel() { Companies = companies, }; return(companyListViewModel); }
public IActionResult Index(string SearchKeyword) { CompanyListViewModel companyListViewModel = new CompanyListViewModel(); if (SearchKeyword == null) { companyListViewModel.Companies = _companyRepository.GetName(null); } else { companyListViewModel.Companies = _companyRepository.GetName(SearchKeyword); } return(View(companyListViewModel)); }
public ContactListViewModel(Contact entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } Id = entity.Id; FirstName = entity.FirstName; LastName = entity.LastName; Phone = entity.Phone; Email = entity.Email; CompanyId = entity.CompanyId; Company = entity.Company != null ? new CompanyListViewModel(entity.Company) : null; }
public ActionResult Index(int page) { ApplicationDbContext db = new ApplicationDbContext(); var list = (from n in db.Companies select n).OrderBy(n => n.CompanyId).Skip(page * 10).Take(10).ToList(); int count = (from n in db.Companies select n).Count(); CompanyListViewModel companyListViewModel = new CompanyListViewModel { Comapnies = AutoMapper.Mapper.Map <List <Company>, List <CompanyViewModel> >(list), NextPage = (count > ((page + 1) * 10)), Page = page, PreviousPage = (page > 0) }; return(View(companyListViewModel)); }
public MainWindow() { InitializeComponent(); // GenerateMockData.GenerateAllData(); MainContext = new TecContext(); _candidateService = new CandidateService(MainContext); _candidateListViewModel = new CandidateListViewModel(_candidateService); _companyService = new CompanyService(MainContext); _companyListViewModel = new CompanyListViewModel(_companyService); _qualificationService = new QualificationService(MainContext); _qualificationListViewModel = new QualificationListViewModel(_qualificationService); _jobHistoryService = new JobHistoryService(MainContext); _jobHistoryListViewModel = new JobHistoryListViewModel(_jobHistoryService); _placementService = new PlacementService(MainContext); _placementListViewModel = new PlacementListViewModel(_placementService); _openingService = new OpeningService(MainContext); _openingListViewModel = new OpeningListViewModel(_openingService); _courseService = new CourseService(MainContext); _courseListViewModel = new CourseListViewModel(_courseService); _trainingSessionService = new TrainingSessionService(MainContext); _scheduleService = new ScheduleService(MainContext); _trainingSessionListViewModel = new TrainingSessionListViewModel(_trainingSessionService); CandidateTab.DataContext = _candidateListViewModel; CompanyTab.DataContext = _companyListViewModel; QualificationTab.DataContext = _qualificationListViewModel; HistoryTab.DataContext = _jobHistoryListViewModel; OpeningTab.DataContext = _openingListViewModel; PlacementTab.DataContext = _placementListViewModel; CourseTab.DataContext = _courseListViewModel; SessionTab.DataContext = _trainingSessionListViewModel; }
public async Task <CompanyListViewModel> GetCompanies() { CompanyListViewModel companyListViewModel = new CompanyListViewModel(); HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("Username", apiKeyUsername); client.DefaultRequestHeaders.Add("Password", apiKeyPassword); string response = await client.GetStringAsync($"{apiBaseUrl}/api/companies"); CompanyViewModel companyViewModel = JsonConvert.DeserializeObject <CompanyViewModel>(response); companyListViewModel.Companies = companyViewModel.Companies; companyListViewModel.FilteredCompanies = companyViewModel.Companies; return(companyListViewModel); }
public async Task <IActionResult> CompanyList() { companies = new List <Company>(); using (var httpClient = new HttpClient()) { using (var response = await httpClient.GetAsync("http://stagecheck_api:80/api/Companies")) { string apiResponse = await response.Content.ReadAsStringAsync(); companies = JsonConvert.DeserializeObject <List <Company> >(apiResponse); } } CompanyListViewModel viewModel = new CompanyListViewModel() { Companies = companies, }; return(View(viewModel)); }
// GET: Company public ActionResult CompanyReport() { int CompanyId = (int)(Session["CompanyId"]); CompanyListViewModel companies = new CompanyListViewModel(); CompanyList = _ICompanyService.GetAllCompany(CompanyId).Select(c => new CompanyViewModel { Id = c.Id, Address1 = c.Address1, Address2 = c.Address2, ContactName = c.ContactName, Email = c.Email, Lat = c.Lat, Lng = c.Lng, Phone1 = c.Phone1, Phone2 = c.Phone2, Title = c.Title, Website = c.Website, ZipCode = c.ZipCode }).ToList(); companies.Companies = CompanyList; return(View("Company", companies)); }
public IActionResult Create() { CompanyListViewModel companyListViewModel = new CompanyListViewModel(); return(View(companyListViewModel)); }
public ContentResult Search(int page, int rows, string sidx, string sord, string filters, string searchField, string searchOper, string searchString) { var model = new CompanyListViewModel(); var result = new ContentResult() { Content = model.CompaniesGrid.Search(sidx, sord, page, rows, true, filters, searchField, searchOper, searchString), ContentType = "application/json" }; return result; }
public ActionResult Index() { var model = new CompanyListViewModel { HasCreatePermission = _rightService.UserHasRight(Common.LoggedInUser.UserName, Rights.Company, RightOperation.Create), HasEditPermission = _rightService.UserHasRight(Common.LoggedInUser.UserName, Rights.Company, RightOperation.Update), HasExportPermission = _rightService.UserHasRight(Common.LoggedInUser.UserName, Rights.CompanyExport, RightOperation.Execute) }; return View(model); }
public FileStreamResult Export(string sidx, string sord, string filters) { var model = new CompanyListViewModel(); Stream fileStream = new MemoryStream(_excelService.GetExcel(model.CompaniesGrid, "Companies", sidx, sord, filters)); HttpContext.Response.AddHeader("content-disposition", "attachment; filename=Companies.xlsx"); return new FileStreamResult(fileStream, "application/ms-excel"); }
public CompanyListPage() { InitializeComponent(); BindingContext = viewModel = new CompanyListViewModel(); }