forked from ardalis/ddd-vet-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working on UI and appointment creation
- Loading branch information
Showing
7 changed files
with
252 additions
and
47 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
FrontDeskSolution/FrontDesk.Core/Services/PatientRegistrationService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
FrontDeskSolution/FrontDesk.Web/Controllers/AppointmentController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
using FrontDesk.Web.Models; | ||
|
||
namespace FrontDesk.Web.Controllers | ||
{ | ||
public class AppointmentController : Controller | ||
{ | ||
// | ||
// GET: /Appointment/ | ||
|
||
public ActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
|
||
// | ||
// GET: /Appointment/Details/5 | ||
|
||
public ActionResult Details(int id) | ||
{ | ||
return View(); | ||
} | ||
|
||
// | ||
// GET: /Appointment/Create | ||
|
||
public ActionResult Create() | ||
{ | ||
var model = new CreateAppointmentViewModel(); | ||
model.Doctors = new SelectList(new List<SelectListItem>() | ||
{ | ||
new SelectListItem() { Text="Doctor McDreamy", Value="Doct McDreamy" }, | ||
new SelectListItem() { Text="Doctor Smith" }, | ||
new SelectListItem() { Text="Doctor Who" }, | ||
new SelectListItem() { Text="Doctor Zhivago" } | ||
}); | ||
|
||
return View(model); | ||
} | ||
|
||
// | ||
// POST: /Appointment/Create | ||
|
||
[HttpPost] | ||
public ActionResult Create(FormCollection collection) | ||
{ | ||
try | ||
{ | ||
// TODO: Add insert logic here | ||
|
||
return RedirectToAction("Index"); | ||
} | ||
catch | ||
{ | ||
return View(); | ||
} | ||
} | ||
|
||
// | ||
// GET: /Appointment/Edit/5 | ||
|
||
public ActionResult Edit(int id) | ||
{ | ||
return View(); | ||
} | ||
|
||
// | ||
// POST: /Appointment/Edit/5 | ||
|
||
[HttpPost] | ||
public ActionResult Edit(int id, FormCollection collection) | ||
{ | ||
try | ||
{ | ||
// TODO: Add update logic here | ||
|
||
return RedirectToAction("Index"); | ||
} | ||
catch | ||
{ | ||
return View(); | ||
} | ||
} | ||
|
||
// | ||
// GET: /Appointment/Delete/5 | ||
|
||
public ActionResult Delete(int id) | ||
{ | ||
return View(); | ||
} | ||
|
||
// | ||
// POST: /Appointment/Delete/5 | ||
|
||
[HttpPost] | ||
public ActionResult Delete(int id, FormCollection collection) | ||
{ | ||
try | ||
{ | ||
// TODO: Add delete logic here | ||
|
||
return RedirectToAction("Index"); | ||
} | ||
catch | ||
{ | ||
return View(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
FrontDeskSolution/FrontDesk.Web/Models/CreateAppointmentViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Web.Mvc; | ||
|
||
namespace FrontDesk.Web.Models | ||
{ | ||
public class CreateAppointmentViewModel | ||
{ | ||
public Guid PatientId { get; set; } | ||
public Guid ClientId { get; set; } | ||
public DateTime DateOfAppointment { get; set; } | ||
public TimeSpan Duration { get; set; } | ||
public Guid SelectedDoctor { get; set; } | ||
public SelectList Doctors { get; set; } | ||
public string Details { get; set; } | ||
} | ||
|
||
public class DoctorViewModel | ||
{ | ||
public Guid DoctorId { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
FrontDeskSolution/FrontDesk.Web/Views/Appointment/Create.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@model FrontDesk.Web.Models.CreateAppointmentViewModel | ||
|
||
@{ | ||
ViewBag.Title = "New Appointment"; | ||
} | ||
|
||
<h2>New Appointment</h2> | ||
|
||
@using (Html.BeginForm()) { | ||
@Html.AntiForgeryToken() | ||
@Html.ValidationSummary(true) | ||
|
||
<fieldset> | ||
<div class="editor-label"> | ||
Appointment For (choose client) | ||
</div> | ||
<div class="editor-field"> | ||
<input type="text" value="Type Client Name To Search" /> | ||
<input type="button" value="Search" /> | ||
</div> | ||
<div class="editor-label"> | ||
Patient / Pet Name | ||
</div> | ||
<div class="editor-field"> | ||
(dropdown) | ||
</div> | ||
|
||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(model => model.DateOfAppointment) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.EditorFor(model => model.DateOfAppointment) | ||
@Html.ValidationMessageFor(model => model.DateOfAppointment) | ||
</div> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(model => model.Duration) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.EditorFor(model => model.Duration) | ||
@Html.ValidationMessageFor(model => model.Duration) | ||
</div> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(model => model.Doctors) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.DropDownListFor(model => model.SelectedDoctor, Model.Doctors); | ||
@Html.ValidationMessageFor(model => model.SelectedDoctor) | ||
</div> | ||
|
||
<div class="editor-label"> | ||
@Html.LabelFor(model => model.Details) | ||
</div> | ||
<div class="editor-field"> | ||
@Html.EditorFor(model => model.Details) | ||
@Html.ValidationMessageFor(model => model.Details) | ||
</div> | ||
|
||
<p> | ||
<input type="submit" value="Create" /> | ||
</p> | ||
</fieldset> | ||
} | ||
|
||
<div> | ||
@Html.ActionLink("Back to List", "Index") | ||
</div> | ||
|
||
@section Scripts { | ||
@Scripts.Render("~/bundles/jqueryval") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,37 @@ | ||
<div id="body"> | ||
<section class="featured"> | ||
<div class="content-wrapper"> | ||
<hgroup class="title"> | ||
<h1>Welcome to ASP.NET Web API!</h1> | ||
<h2>Modify the code in this template to jump-start your ASP.NET Web API development.</h2> | ||
</hgroup> | ||
<p> | ||
ASP.NET Web API allows you to expose your applications, data and services to the | ||
web directly over HTTP. | ||
</p> | ||
<p> | ||
To learn more about ASP.NET Web API visit the | ||
<a href="http://go.microsoft.com/fwlink/?LinkID=238195" title="ASP.NET Web API Website">ASP.NET Web API Website</a>. | ||
The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET Web API. | ||
If you have any questions about ASP.NET Web API, visit | ||
<a href="http://go.microsoft.com/fwlink/?LinkID=238196" title="ASP.NET Web API Forum">our forums</a>. | ||
</p> | ||
</div> | ||
</section> | ||
<section class="content-wrapper main-content clear-fix"> | ||
<h3>We suggest the following steps:</h3> | ||
<ol class="round"> | ||
<li class="one"> | ||
<h5>Getting Started</h5> | ||
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach | ||
a broad range of clients, including browsers and mobile devices. ASP.NET Web API | ||
is an ideal platform for building RESTful applications on the .NET Framework. | ||
<a href="http://go.microsoft.com/fwlink/?LinkId=245160">Learn more…</a> | ||
</li> | ||
<h2>Appointments</h2> | ||
<p>Add a grid with today's appointments and pictures of the patients</p> | ||
<table> | ||
<tr> | ||
<th>Check In / Out</th> | ||
<th>Time</th> | ||
<th>Location</th> | ||
<th>Patient</th> | ||
<th>Client</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
<input type="button" value="Check Out" /></td> | ||
<td>8:00 AM</td> | ||
<td>Exam Room One</td> | ||
<td> | ||
<img src="" alt="Darwin" />Darwin</td> | ||
<td>Steve Smith<br /> | ||
123 Main Street<br /> | ||
Kent, OH 44240</td> | ||
|
||
<li class="two"> | ||
<h5>Add NuGet packages and jump-start your coding</h5> | ||
NuGet makes it easy to install and update free libraries and tools. | ||
<a href="http://go.microsoft.com/fwlink/?LinkId=245161">Learn more…</a> | ||
</li> | ||
<li class="three"> | ||
<h5>Find Web Hosting</h5> | ||
You can easily find a web hosting company that offers the right mix of features | ||
and price for your applications. | ||
<a href="http://go.microsoft.com/fwlink/?LinkId=245164">Learn more…</a> | ||
</li> | ||
</ol> | ||
</section> | ||
</tr> | ||
<tr> | ||
<td> | ||
<input type="button" value="Check In" /></td> | ||
<td>9:00 AM</td> | ||
<td>Not Arrived</td> | ||
<td> | ||
<img src="http://thedatafarm.com/blog/files/media/image/WindowsLiveWriter/Sampsongetsagroomingandawalkinthewoods_7F6B/handsome%20sampson_thumb.png" alt="Sampson" style="max-height:100px;"/><br />Sampson</td> | ||
<td>Julie Lerman<br /> | ||
123 Main Street<br /> | ||
Burlington, VT 11111</td> | ||
|
||
</tr> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters