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();
 }
示例#3
0
        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();
            }
        }
示例#4
0
        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));
        }
示例#5
0
 //add record
 public void addPatient(AddPatientModel patient)
 {
     PatientDAL.addPatient(patient);
 }
示例#6
0
        public IActionResult AddPatient()
        {
            var model = new AddPatientModel();

            return(View("/Views/Dashboard/Doctor/AddPatient.cshtml", model));
        }