public void Insert(PatientViewModel patientModel) { using (var repo = new PatientRepository()) { var dis = new Patient(); if (true) { dis.PatientId = patientModel.PatientId; dis.UserName = patientModel.UserName; dis.FirstName = patientModel.FirstName; dis.LastName = patientModel.LastName; dis.IdentificationNumber = patientModel.IdentificationNumber; dis.Cellphone = patientModel.Cellphone; dis.Email = patientModel.Email; dis.Occupation = patientModel.Occupation; dis.SecurityAnswer = patientModel.SecurityAnswer; dis.Address = patientModel.Address; dis.Telephone = patientModel.Telephone; dis.City = patientModel.City; dis.State = patientModel.State; dis.Country = patientModel.Country; dis.ZipCode = patientModel.ZipCode; } repo.Insert(dis); AddUserToPatientRole(dis.UserName); } }
public void Delete(PatientViewModel patientModel) { using (var repo = new PatientRepository()) { var dis = new Patient(); dis = repo.GetById(patientModel.PatientId); repo.Delete(dis); } }
public void Update(Patient model) { _storeLocationRepository.Update(model); }
public void Insert(Patient model) { _storeLocationRepository.Insert(model); }
public void Delete(Patient model) { _storeLocationRepository.Delete(model); }
//2 convert private static Patient ConvertToViewModel(PatientViewModel model) { var ash = new Patient { Cellphone = model.Cellphone, Email = model.Email, FirstName = model.FirstName, SecurityAnswer = model.SecurityAnswer, IdentificationNumber = model.IdentificationNumber, LastName = model.LastName, Occupation = model.Occupation, PatientId = model.PatientId, SecurityQuestion = model.SecurityQuestion, UserName = model.UserName, Address = model.Address, Telephone = model.Telephone, City = model.City, State = model.State, Country = model.Country, ZipCode = model.ZipCode }; return ash; }