public async Task <IActionResult> Profile(int employeeId) { var employee = await _apiContext.GetRequest("Employees/" + employeeId); var ep = JsonConvert.DeserializeObject <Employee>(employee.Value.ToString()); return(View(ep)); }
public async Task <IActionResult> Edit(int customerId) { var res = await _apiContext.GetRequest("Customers/" + customerId); var customer = JsonConvert.DeserializeObject <Customer>(res.Value.ToString()); var list = await _apiContext.GetRequest("Vouchers/"); var voucherList = JsonConvert.DeserializeObject <IEnumerable <Voucher> >(list.Value.ToString()); ViewData["vouchers"] = voucherList; ViewData["zapisyKlienta"] = 0; ViewData["zakupioneUslugi"] = 0; ViewData["zakupioneProdukty"] = 0; return(View(customer)); }
public async Task <IActionResult> Edit(int productId) { var res = await _apiContext.GetRequest("Products/" + productId); var product = JsonConvert.DeserializeObject <Product>(res.Value.ToString()); return(View(product)); }
public async Task <JsonResult> GetActivity(int acId) { var result = await _apiContext.GetRequest("Activities/" + acId); var ac = JsonConvert.DeserializeObject <Activity>(result.Value.ToString()); var categories_response = await _apiContext.GetRequest("Categories/"); var categories_list = JsonConvert.DeserializeObject <List <Category> >(categories_response.Value.ToString()); int clubId = 1; var employees = await _apiContext.GetRequest("EmployeeClubs/" + clubId + ""); var list = JsonConvert.DeserializeObject <IEnumerable <EmployeeClub> >(employees.Value.ToString()); return(new JsonResult(new { activity = ac, categories = categories_list, employees = list })); }
public async Task <Timetable> GetTimetable(int timetableId) { var response = await _apiContext.GetRequest("Timetables/" + timetableId); var timetables_list = JsonConvert.DeserializeObject <Timetable>(response.Value.ToString()); return(timetables_list); }
public async Task <IActionResult> Index() { ViewData["Header"] = "Your dashboard"; var ac = await _apiContext.GetRequest("TimetableActivities/?incoming=true&related=true"); var res = JsonConvert.DeserializeObject <IEnumerable <TimetableActivity> >(ac.Value.ToString()); var en = await _apiContext.GetRequest("Queue/"); var entry = JsonConvert.DeserializeObject <IEnumerable <dynamic> >(en.Value.ToString()); ViewData["recentActivities"] = res .OrderByDescending(a => a.Timetable_Activity_Starttime) .Take(5).ToList(); ViewData["recentEntries"] = entry .OrderByDescending(q => q.created) .Take(5).ToList(); return(View()); }
public async Task <IActionResult> List() { ViewData["Header"] = "Lista dostępnych karnetów"; var list = await _apiContext.GetRequest("Vouchers/"); var voucherList = JsonConvert.DeserializeObject <IEnumerable <Voucher> >(list.Value.ToString()); List <VoucherView> vouchersView = new List <VoucherView>(); foreach (var vc in voucherList) { if (vc.Activitiy_Id != null && vc.Activitiy_Id.Count > 0) { foreach (var ac in vc.Activitiy_Id) { if (ac != 0) { vc.Activities.Add(await GetActivity(ac)); } } } } return(View(voucherList)); }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { _logger.LogDebug($"GracePeriodManagerService is starting."); stoppingToken.Register(() => _logger.LogDebug($" GracePeriod background task is stopping.")); while (!stoppingToken.IsCancellationRequested) { _logger.LogDebug($"GracePeriod task doing background work."); var res = await _apiContext.GetRequest("Queue"); await Task.Delay(4000, stoppingToken); } _logger.LogDebug($"GracePeriod background task is stopping."); }
public async Task <IEnumerable <Club> > GetClubs() { var res = await _apiContext.GetRequest("Clubs/"); return(JsonConvert.DeserializeObject <IEnumerable <Club> >(res.Value.ToString())); }
public async Task <Category> GetCategory(int catId) { var res = await _apiContext.GetRequest("Categories/" + catId); return(JsonConvert.DeserializeObject <Category>(res.Value.ToString())); }