public ActionResult PartialViewLookup(string ID, string DBOperation = "") { SharedViewModel vm = new SharedViewModel(); vm.Appointments = _appoDal.GetAllAppointments().TranslateAppointmentDEList(); if (!string.IsNullOrWhiteSpace(DBOperation)) { if (DBOperation == "DELETE") { int id = Convert.ToInt32(ID); if (_appoDal.DeleteAppointment(id)) { vm.Appointments = _appoDal.GetAllAppointments().TranslateAppointmentDEList(); } } } return(PartialView(vm)); }