private void appointments_datagridview_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0 && senderGrid.Columns[e.ColumnIndex].ToString() == this.appointments_datagridview.Columns["EditAppointment"].ToString()) { DataGridViewRow selectedAppointment = this.appointments_datagridview.CurrentRow; int appointmentID = int.Parse(this.appointments_datagridview.Rows[e.RowIndex].Cells["AppointmentID"].Value.ToString()); Appointment appointment = this.appointmentController.GetAppointmentByID(appointmentID); EditAppointment editAppointment = new EditAppointment(); editAppointment.PopulateEditAppointmentFields(appointment); if (!(appointment.Scheduled_Date < DateTime.Now)) { DialogResult result = editAppointment.ShowDialog(); if (result == DialogResult.OK) { this.Reset_Button_Click(sender, e); } } else { MessageBox.Show("This appointment has passed. Cannot Edit."); } } }
public ActionResult Edit(int id) { EditAppointment modelView = new EditAppointment(); // AppointmentDto appointmentDto = new AppointmentDto(); //Get the current Appointment object string url = "AppointmentData/FindAppointment/" + id; HttpResponseMessage response = client.GetAsync(url).Result; if (response.IsSuccessStatusCode) { AppointmentDto selectedAppointment = response.Content.ReadAsAsync <AppointmentDto>().Result; modelView.AppointmentDto = selectedAppointment; } else { return(RedirectToAction("Error")); } //The view needs to be sent a list of all the Departments so the client can select an Apointmenr for an appointmnet in the view modelView.DepartmentsSelectList = GetDepartmentSelectList(); //The view needs to be sent a list of all the Doctors so the client can select a Doctors for appointmnet in the view modelView.DoctorsSelectList = GetDoctorsSelectList(); return(View(modelView)); }
private void allAppoitnmentsData_CellContentClick(object sender, DataGridViewCellEventArgs e) { int index = e.RowIndex; appointment app; if (index > -1) { if (this.filteredAppointments.Rows.Count != 0) { string title = filteredAppointments.Rows[index]["title"] as string; app = dbConn.getAppointmentByTitle(title); } else if (this.searchedAllAppointments.Rows.Count != 0) { string title = searchedAllAppointments.Rows[index]["title"] as string; app = dbConn.getAppointmentByTitle(title); } else { string title = dtAllAppointments.Rows[index]["title"] as string; app = dbConn.getAppointmentByTitle(title); } EditAppointment ea = new EditAppointment(app); ea.ShowDialog(); } }
public async Task <IActionResult> Edit(long id, EditAppointment model) { if (id != model.Id) { return(NotFound()); } if (ModelState.IsValid) { Appointment appointment = _context.Appointment.Include(a => a.Doctor).Include(a => a.Patient).Single(a => a.Id == id); if (appointment == null) { return(NotFound()); } DateTime dateTime = DateTime.Parse(model.Date + " " + model.Time); if (appointment.DateTime == dateTime) { appointment.Patient = _context.Patients.Find(model.SelectPatientId); if (appointment.Patient != null) { _context.Appointment.Update(appointment); _context.SaveChanges(); } return(RedirectToAction("Index")); } if (_context.Appointment.Any(a => a.DateTime == dateTime && a.Doctor == appointment.Doctor)) { ViewData["Message"] = "This period is reserved for another patient"; } else { appointment.DateTime = dateTime; appointment.Patient = _context.Patients.Find(model.SelectPatientId); _context.Appointment.Update(appointment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } } EditAppointment A = new EditAppointment(model.SelectPatientId, _context); A.Date = DateTime.Now.Date.ToString("yyyy-MM-dd"); A.Time = DateTime.Now.ToString("HH:mm"); A.Id = id; return(View(A)); }
public ActionResult Create() { //Model used to combine an appointmen object, departments list and doctors list for dropdowns EditAppointment modelView = new EditAppointment(); // Appointment is empty for before creating new Appointment modelView.AppointmentDto = new AppointmentDto(); //The view needs to be sent a list of all the Departments so the client can select an Apointment for an appointmnet in the view modelView.DepartmentsSelectList = GetDepartmentSelectList(); //The view needs to be sent a list of all the Doctors so the client can select a Doctor for appointmnet in the view modelView.DoctorsSelectList = GetDoctorsSelectList(); return(View(modelView)); }
/// <summary> /// Handles the Click event of the EditAppointment_Button control. Fails if no appointment is selected but if one is it is loaded into a <see cref = "OpticianDB.Forms.Dialogs.EditAppointment" /> form and then the list is refreshed after the form closes /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param> private void EditAppointment_Button_Click(object sender, EventArgs e) { if (appointments_DayView.SelectedAppointment == null) { MessageBox.Show("No appointment was selected to be loaded", "Could not load appointment", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (EditAppointment ea1 = new EditAppointment(GetSelectedAppointmentId())) { ea1.ShowDialog(); } dbb.RefreshAdaptor(); RefreshAppointments(); }
public ActionResult Create(EditAppointment appointmentInfo) { string url = "appointmentdata/AddAppointment"; HttpContent content = new StringContent(jss.Serialize(appointmentInfo.AppointmentDto)); content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); HttpResponseMessage response = client.PostAsync(url, content).Result; if (response.IsSuccessStatusCode) { return(RedirectToAction("List")); } else { return(RedirectToAction("Error")); } }
public ActionResult Edit(int id, EditAppointment modelView) { string url = "appointmentdata/updateappointment/" + id; HttpContent content = new StringContent(jss.Serialize(modelView.AppointmentDto)); content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); HttpResponseMessage response = client.PostAsync(url, content).Result; if (response.IsSuccessStatusCode) { Debug.WriteLine("update Appointment request succeeded"); return(RedirectToAction("List")); } else { Debug.WriteLine("update Appointment request failed with error: " + response.StatusCode.ToString()); return(RedirectToAction("Error")); } }
public async Task <IActionResult> Edit(long id = 0) { if (id == 0) { return(NotFound()); } Appointment appointment = _context.Appointment.Include(a => a.Patient).Where(a => a.Id == id).Single <Appointment>(); if (appointment == null) { return(NotFound()); } EditAppointment A = new EditAppointment(appointment.Patient.Id, _context); A.Date = DateTime.Now.Date.ToString("yyyy-MM-dd"); A.Time = DateTime.Now.ToString("HH:mm"); A.Id = id; return(View(A)); }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { BeginContext(51, 36, true); WriteLiteral(" <ul>\r\n <li>\r\n "); EndContext(); BeginContext(87, 120, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a7283", async() => { BeginContext(133, 70, true); WriteLiteral(" <i class=\"fas fa-home\" style=\"color:#fff;font-size:20px\"></i> Clinic"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_0.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(207, 178, true); WriteLiteral("\r\n </li>\r\n <li class=\"dropdown\">\r\n <a href=\"javascript:void(0)\" class=\"dropbtn\">Doctors</a>\r\n <div class=\"dropdown-content\">\r\n "); EndContext(); BeginContext(385, 65, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a9121", async() => { BeginContext(435, 11, true); WriteLiteral("Find doctor"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(450, 18, true); WriteLiteral("\r\n "); EndContext(); BeginContext(468, 71, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a10719", async() => { BeginContext(527, 8, true); WriteLiteral("My docor"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(539, 202, true); WriteLiteral("\r\n </div>\r\n </li>\r\n <li class=\"dropdown \">\r\n <a href=\"javascript:void(0)\" class=\"dropbtn\">Patients</a>\r\n <div class=\"dropdown-content \">\r\n "); EndContext(); BeginContext(741, 66, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a12517", async() => { BeginContext(792, 11, true); WriteLiteral("Add patient"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_5.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_6.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(807, 18, true); WriteLiteral("\r\n "); EndContext(); BeginContext(825, 67, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a14116", async() => { BeginContext(876, 12, true); WriteLiteral("Find patient"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_5.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(892, 341, true); WriteLiteral(@" </div> </li> <li class=""dropdown""> <a href=""javascript:void(0)"" class=""dropbtn"">Appointments</a> <div class=""dropdown-content""> <a data-toggle=""modal"" data-target=""#MakeAppointment"" style=""cursor:pointer"">Make an Appointment</a> "); EndContext(); BeginContext(1233, 74, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a16054", async() => { BeginContext(1286, 17, true); WriteLiteral("View Appointments"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_7.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_7); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1307, 45, true); WriteLiteral("\r\n </div>\r\n </li>\r\n "); EndContext(); BeginContext(1352, 48, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("Partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a17693", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_8.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_8); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1400, 19, true); WriteLiteral("\r\n </ul>\r\n\r\n\r\n\r\n"); EndContext(); #line 34 "C:\Users\hp\Desktop\Semester6Projects\Clinic\Clinic\Views\Shared\AssistantBar.cshtml" var date = DateTime.Now; EditAppointment add = new EditAppointment(_context); #line default #line hidden BeginContext(1518, 691, true); WriteLiteral(@"<!-- Modal --> <div class=""modal fade"" id=""MakeAppointment"" tabindex=""-1"" role=""dialog"" aria-labelledby=""exampleModalCenterTitle"" aria-hidden=""true""> <div class=""modal-dialog modal-dialog-centered"" role=""document""> <div class=""modal-content""> <div class=""modal-header""> <h5 class=""modal-title"" id=""exampleModalLongTitle"" style=""font-size:20px"">Appointment</h5> <button type=""button"" class=""close"" data-dismiss=""modal"" aria-label=""Close""> <span aria-hidden=""true"">×</span> </button> </div> <div class=""modal-body""> <h4 class=""text-danger"">"); EndContext(); BeginContext(2210, 19, false); #line 53 "C:\Users\hp\Desktop\Semester6Projects\Clinic\Clinic\Views\Shared\AssistantBar.cshtml" Write(ViewData["Message"]); #line default #line hidden EndContext(); BeginContext(2229, 148, true); WriteLiteral("</h4>\r\n <div class=\"form-group\">\r\n <label class=\"control-label\">Choose the patient</label>\r\n\r\n "); EndContext(); BeginContext(2377, 74, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("select", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a20560", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.SelectTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_9); #line 57 "C:\Users\hp\Desktop\Semester6Projects\Clinic\Clinic\Views\Shared\AssistantBar.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items = add.Patients; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("asp-items", __Microsoft_AspNetCore_Mvc_TagHelpers_SelectTagHelper.Items, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_10); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2451, 175, true); WriteLiteral("\r\n </div>\r\n <div class=\"form-group\">\r\n <label class=\"control-label\">Choose a date</label>\r\n\r\n <input id=\"Y\""); EndContext(); BeginWriteAttribute("value", " value=\"", 2626, "\"", 2667, 1); #line 62 "C:\Users\hp\Desktop\Semester6Projects\Clinic\Clinic\Views\Shared\AssistantBar.cshtml" WriteAttributeValue("", 2634, date.Date.ToString("yyyy-MM-dd"), 2634, 33, false); #line default #line hidden EndWriteAttribute(); BeginContext(2668, 212, true); WriteLiteral(" type=\'date\' class=\"form-control ss\" />\r\n </div>\r\n <div class=\"form-group\">\r\n <label class=\"control-label\">Choose a time</label>\r\n <input id=\"Z\""); EndContext(); BeginWriteAttribute("value", " value=\"", 2880, "\"", 2911, 1); #line 66 "C:\Users\hp\Desktop\Semester6Projects\Clinic\Clinic\Views\Shared\AssistantBar.cshtml" WriteAttributeValue("", 2888, date.ToString("HH:mm"), 2888, 23, false); #line default #line hidden EndWriteAttribute(); BeginContext(2912, 472, true); WriteLiteral(@" type='time' class=""form-control ss"" /> </div> </div> <div class=""modal-footer"" > <div style=""width:80%"" id=""response""></div> <button type=""button"" class=""btn btn-danger"" onclick=""location.reload();"">Close</button> <button type=""button"" class=""btn btn-primary "" onclick=""addAppointment();"">Save </button> </div> </div> </div> </div> "); EndContext(); BeginContext(3384, 40, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "9d8f0155dd1894f66e5b0f50c1d7c1129969593a23962", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_11.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_11); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3424, 1418, true); WriteLiteral(@" <script type=""text/javascript"" src=""http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js""></script> <script type=""text/javascript""> function addAppointment() { document.getElementById(""response"").innerHTML = """"; var X = document.getElementById(""X"").value; var Y = document.getElementById(""Y"").value +"" ""+ document.getElementById(""Z"").value ; //alert(X); //alert(Y); //alert(""Hello""); $.ajax({ type: ""GET"", url: '/Appointments/Create', data: { ""patient"": X, ""appdate"": Y }, contentType: ""application/json; charset=utf-8"", dataType: ""json"", beforeSend: function () { document.getElementById(""response"").innerHTML = ""Creating Appointment""; }, success: function (response) { // Looping over emloyee list and display it document.getElementById(""response"").innerHTML = response.res"); WriteLiteral(@"ult; }, complete: function () { //document.getElementById(""response"").innerHTML = response.result; }, failure: function (jqXHR, textStatus, errorThrown) { alert(""HTTP Status: "" + jqXHR.status + ""; Error Text: "" + jqXHR.responseText); // Display error message } }); } </script> "); EndContext(); }