Example #1
0
        public static int SavePatientDetails(int patientId, PatientDetailsModel patientDetailsModel)
        {
            int resultId = SqlDataAccess.SaveReturnId <PatientDetailsModel>
                           (
                @"INSERT into dbo.PatientDetails (DateOfBirth, Gender, Ethnicity)
                    VALUES (@DateOfBirth, @Gender, @Ethnicity)",
                patientDetailsModel
                           );

            return(SqlDataAccess.Save <PatientModel>
                   (
                       @"UPDATE dbo.Patient
                    SET FK_PatientDetails_Id = @Details
                    WHERE Id = @Id",
                       new PatientModel {
                Id = patientId, Details = resultId
            }
                   ));
        }