internal static FormUser GetFormUserById(int ID)
{
FormUser formUser = null;
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_FORM_USER_GET_BY_ID, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter parameter = new SqlParameter(PN_FORM_USER_ID, System.Data.SqlDbType.Int);
parameter.Direction = System.Data.ParameterDirection.Input;
parameter.Value = ID;
sqlCommand.Parameters.Add(parameter);
sqlCommand.Connection.Open();
using (SqlDataReader reader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
{
while (reader.Read())
{
if (formUser == null)
formUser = new FormUser();
FillFromReader(formUser, reader);
}
reader.Close();
sqlCommand.Connection.Close();
}
}
return formUser;
}