public ActionResult AddPatient(AddPatientModel patient) { if (ModelState.IsValid) { //clalling BLL function PatientLogic.addPatient(patient); } return(View()); }
public AddPatientViewModel(AdminShellViewModel containingVm) { addPatientM = new AddPatientModel(); this.containingVm = containingVm; UpdateDbCommand = new AddToDbCommand(this); TodayDate = DateTime.Today; IsNewPatient = true; BackCommand = new BackCommand(this); Patient = new Patient(); }
public void addPatient(AddPatientModel patient) { if (Sqlcon.State == ConnectionState.Closed) { Sqlcon.Open(); SqlCommand Sqlcmd = new SqlCommand("SP_Add_Patient", Sqlcon); Sqlcmd.CommandType = CommandType.StoredProcedure; Sqlcmd.Parameters.AddWithValue("@PatientName", patient.PatientName); Sqlcmd.Parameters.AddWithValue("@PatientAddress", patient.PatientAddress); Sqlcmd.Parameters.AddWithValue("@PatientContact", patient.PatientContact); Sqlcmd.Parameters.AddWithValue("@PatientEmail", patient.PatientEmail); Sqlcmd.Parameters.AddWithValue("@ZIPCode", patient.ZIPCode); Sqlcmd.ExecuteNonQuery(); Sqlcon.Close(); } }
public async Task <IActionResult> AddPatient(AddPatientModel model) { if (!ModelState.IsValid) { return(View("/Views/Dashboard/Doctor/AddPatient.cshtml", model)); } var result = await _doctorService.AddPatient(model.FirstName, model.LastName, model.EGN, model.PhoneNumber, model.BirthDate, model.Gender); if (result.Succeeded) { return(RedirectToAction("Index")); } foreach (var err in result.Errors) { ModelState.AddModelError("", err); } return(View("/Views/Dashboard/Doctor/AddPatient.cshtml", model)); }
//add record public void addPatient(AddPatientModel patient) { PatientDAL.addPatient(patient); }
public IActionResult AddPatient() { var model = new AddPatientModel(); return(View("/Views/Dashboard/Doctor/AddPatient.cshtml", model)); }