static void Main(string[] args) { Console.WriteLine("Proccess Starting..."); Console.ReadLine(); var residentFilterParams = new ResidentsFilterParams(); AuthenticationService.Authorize(new Model.CurrentUserViewModel { Email = "*****@*****.**", Password = "******" }); var resientsResult = ResidentService.GetResidents(residentFilterParams); GenereteObservations(resientsResult.Collection); var totalPages = Math.Ceiling((double)resientsResult.TotalCount / residentFilterParams.Take); for (var i = 1; i <= totalPages; i++) { residentFilterParams.Skip = residentFilterParams.Take * (i - 1); var residents = ResidentService.GetResidents(residentFilterParams); GenereteObservations(residents.Collection); } Console.WriteLine("Press enter to stop proccess..."); Console.ReadLine(); }
public OralConsultationController() : base() { oralConsultationService = new OralConsultationService(); residentService = new ResidentService(); issueService = new IssueService(); }
public IHttpActionResult Get() { ResidentService residentService = CreateResidentService(); var residents = residentService.GetResidents(); return(Ok(residents)); }
private ResidentService CreateResidentService() { var userId = Guid.Parse(User.Identity.GetUserId()); var residentService = new ResidentService(userId); return(residentService); }
public TypeConsultationController() : base() { typeConsultationService = new TypeConsultationService(); residentService = new ResidentService(); issueService = new IssueService(); companyService = new CompanyService(); }
public void TestMethod1() { ResidentService s = new ResidentService(); var o = s.GetOralConsultationsByResidentID(6); Assert.AreEqual(o.Count, 1); var t = s.GetTypeConsultationsByResidentID(6); Assert.AreEqual(t.Count, 1); }
public ActionResult Edit(ResidentEdit resident) { if (ModelState.IsValid) { _userId = Guid.Parse(User.Identity.GetUserId()); _residentService = new ResidentService(_userId); _residentService.EditResident(resident); return(RedirectToAction("Index")); } ViewBag.NeighborhoodId = new SelectList(db.Neighborhoods, "NeighborhoodId", "Name", resident.NeighborhoodId); return(View(resident)); }
public ResidentController() { db = new StoreContext(); service = new ResidentService(); }