//Put Method public string UpdateOldAppointment(AppointmentTBL app) { var appointment3 = _appointmentData.UpdateAppointment(app.AppointmentId, app.AppointmentTypeId, app.ConsumerId, app.StatusCode, app.ConsumerName); return(appointment3); }
public ActionResult Delete(int id) { AppointmentTBL appointmentTBL = db.AppointmentTBLs.Find(id); db.AppointmentTBLs.Remove(appointmentTBL); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(AppointmentTBL appointment) { if (ModelState.IsValid) { db.Entry(appointment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(appointment)); }
public ActionResult Create(AppointmentTBL appointment) { var app = db.AppointmentTBLs.SingleOrDefault(c => c.ConsumerName == appointment.ConsumerName); if (app == null) { db.AppointmentTBLs.Add(appointment); db.SaveChanges(); return(RedirectToAction("index")); } return(View("index")); }
//Deleting the appointment public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AppointmentTBL appointmentTbl = db.AppointmentTBLs.Find(id); if (appointmentTbl == null) { return(HttpNotFound()); } return(View(appointmentTbl)); }
public ActionResult Create(AppointmentTBL appointment) { var app = db.AppointmentTBLs.SingleOrDefault(c => c.ConsumerName == appointment.ConsumerName); if (app == null) { db.AppointmentTBLs.Add(appointment); db.SaveChanges(); //return RedirectToAction("index"); return(Content("Record Added Successfully")); } //return View("index"); return(Content("Already Existed")); }
//Post Method public string InsertAppointment(int appointmentId, int appointmentTypeId, string consumerId, string statusCode, string consumerName) { var appointment1 = new AppointmentTBL { AppointmentId = appointmentId, AppointmentTypeId = appointmentTypeId, ConsumerId = consumerId, StatusCode = statusCode, ConsumerName = consumerName }; if (db.AppointmentTBLs.Any(c => c.ConsumerName.Equals(consumerName)))//db.AppointmentTBLs.SingleOrDefault(c => c.ConsumerName == consumerName)) { return("Already Exist"); } else { db.AppointmentTBLs.Add(appointment1); db.SaveChanges(); return("Success"); } }
//Updating the AppointmentId public string UpdateAppointment(AppointmentTBL app) { var response = _oasService.UpdateOldAppointment(app); return(response); }
//inserting New appointment -Pavi public string InsertAppointment(AppointmentTBL app) { var response = _oasService.InsertNewAppointment(app); return(response); }
public ActionResult Get(int id) { AppointmentTBL appointment = db.AppointmentTBLs.Where(x => x.AppointmentId == id).SingleOrDefault(); return(View(appointment)); }
//Post Method public string InsertNewAppointment(AppointmentTBL app) { var appointment = _appointmentData.InsertAppointment(app.AppointmentId, app.AppointmentTypeId, app.ConsumerId, app.StatusCode, app.ConsumerName); return(appointment); }