public AppointmentDataAccess.appointment SetUpAppointment(AppointmentDataAccess.appointment appointment) { AppointmentDataAccess.appointment result = null; using (var sqlConnection = new SqlConnection(ConnectionString)) { DynamicParameters parameters = new DynamicParameters(); sqlConnection.Open(); parameters.Add("@appointmentId", appointment.appointmentId, DbType.String, ParameterDirection.Input); parameters.Add("@appointmentStartDate", appointment.appointmentStartDate, DbType.String, ParameterDirection.Input); parameters.Add("@appointmentEndDate", appointment.appointmentEndDate, DbType.String, ParameterDirection.Input); parameters.Add("@memo", appointment.memo, DbType.String, ParameterDirection.Input); parameters.Add("@cancelled", appointment.cancelled ? 1 : 0, DbType.String, ParameterDirection.Input); parameters.Add("@confirmed", appointment.confirmed ? 1 : 0, DbType.String, ParameterDirection.Input); parameters.Add("@completed", appointment.completed ? 1 : 0, DbType.String, ParameterDirection.Input); result = sqlConnection.QueryFirstOrDefault <AppointmentDataAccess.appointment>("Appointment_add", parameters, commandType: CommandType.StoredProcedure); sqlConnection.Close(); } return(result); }
public AppointmentDataAccess.appointment SetUpAppointment(AppointmentDataAccess.appointment appointment) { return(DataProvider.Instance.SetUpAppointment(appointment)); }