public ActionResult EditConsultation(EditConsultationViewModel model) { var existingConsultation = ConsultationServices.ClassObject.GetConsultation(model.ID); existingConsultation.IDPacient = PacientServices.ClassObject.GetPacientIDByCNP(model.CNP); existingConsultation.IDDoctor = model.IDDoctor; existingConsultation.Data = model.Data; existingConsultation.Simptome = model.Simptome; existingConsultation.Diagnostic = model.Diagnostic; existingConsultation.Tratament = model.Tratament; existingConsultation.Pacient = PacientServices.ClassObject.GetPacientByCNP(model.CNP); ConsultationServices.ClassObject.UpdateConsultation(existingConsultation); return(RedirectToAction("ConsultationsTable")); }
public ActionResult EditConsultation(int ID) { EditConsultationViewModel model = new EditConsultationViewModel(); var consultation = ConsultationServices.ClassObject.GetConsultation(ID); model.Pacients = PacientServices.ClassObject.GetAllThePacients(); model.Doctors = DoctorServices.ClassObject.GetAllTheDoctors(); model.ID = consultation.ID; model.CNP = PacientServices.ClassObject.GetPacientCNPByID(ID); model.Data = consultation.Data; model.Simptome = consultation.Simptome; model.Diagnostic = consultation.Diagnostic; model.Tratament = consultation.Tratament; //model.PacientID = consultation.PacientID; return(PartialView(model)); }