public List <Model.Sastanci> GetTodaySastanci(SastanciSearchRequest request) { var query = _context.Sastanci.AsQueryable().Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); query = query.Where(x => x.DatumSastanka.Date == DateTime.Now.Date).Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); query = query.Where(p => p.IsDeleted == false).Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); var list = query.ToList(); return(_mapper.Map <List <Model.Sastanci> >(list)); }
public async void RefreshToolbox(object sender, EventArgs e) { if (_calendarDroppedDown) { return; } else { var search = new SastanciSearchRequest { DatumSastanka = dateTimePicker1.Value }; var result = await _aPIService.Get <List <Model.Sastanci> >(search); dgvSastanci.DataSource = result; } }
public List <Model.Sastanci> Get(SastanciSearchRequest request) { var query = _context.Sastanci.AsQueryable().Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); var datum = DateTime.MinValue; if (datum != request.DatumSastanka.Date) { request.DatumSastanka = request.DatumSastanka.AddHours(-2); query = query.Where(x => x.DatumSastanka.ToString("dd-MMM-yyyy").StartsWith(request.DatumSastanka.ToString("dd-MMM-yyyy"))).Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); } if (request.Odobreno == false) { query = query.Where(x => x.Odobreno == false).Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); } query = query.Where(p => p.IsDeleted == false).Include(c => c.Klijent).Include(z => z.Zaposlenici).Include(g => g.VrstaUsluge); var list = query.ToList(); return(_mapper.Map <List <Model.Sastanci> >(list)); }
private async void FrmIndex_Load(object sender, EventArgs e) { if (_ulogaAdvokat) { var search1 = new KorisniciSearchRequest { Status = false }; var BrojZahtjeva1 = await _aPIService1.Get <List <Model.Korisnici> >(search1); if (BrojZahtjeva1.Count > 0) { notifyIcon2.Visible = true; notifyIcon2.Icon = SystemIcons.Information; notifyIcon2.BalloonTipTitle = "Zahtjevi za registraciju"; notifyIcon2.BalloonTipText = "imate " + BrojZahtjeva1.Count + " novih zahtjeva za registraciju klijenata!"; notifyIcon2.ShowBalloonTip(5000); search1 = new KorisniciSearchRequest { }; } label1.Text = _ulogaAdvokatIme;; tsmSastanci.Visible = false; tspTroskovi.Visible = false; tsmUgovori.Visible = false; tsmUred.Visible = false; tsmZadaci.Visible = false; tsmZaposlenici.Visible = false; } else if (_ulogaMenadzer) { label1.Text = _ulogaMenadzerIme; tsmKlijenti.Visible = false; tsmPredmeti.Visible = false; tsmRocista.Visible = false; tsmRadniSati.Visible = false; tsmSastanci.Visible = false; tspTroskovi.Visible = false; tsmUred.Visible = false; } else { var search = new SastanciSearchRequest { Odobreno = false, DatumSastanka = DateTime.MinValue }; var BrojZahtjeva = await _aPIService.Get <List <Model.Sastanci> >(search); if (BrojZahtjeva.Count > 0) { notifyIcon1.Visible = true; notifyIcon1.Icon = SystemIcons.Information; notifyIcon1.BalloonTipTitle = "Zahtjevi za satanak"; notifyIcon1.BalloonTipText = "imate " + BrojZahtjeva.Count + " neodobrenih satanaka!"; notifyIcon1.ShowBalloonTip(5000); search = new SastanciSearchRequest { }; } label1.Text = _ulogaSekretarIme; tsmKlijenti.Visible = false; tsmPredmeti.Visible = false; tsmRocista.Visible = false; tsmRadniSati.Visible = false; tsmUgovori.Visible = false; tsmZadaci.Visible = false; tsmZaposlenici.Visible = false; } }
public List <Model.Sastanci> todaySastanci([FromQuery] SastanciSearchRequest request) { return(_sastanciService.GetTodaySastanci(request)); }