public static Person ReturnItem(String email) { try { SqlConnection connect = RetaloDB.GetConnection(); string selectStatement = "Select *" + " FROM Person" + " Where Email = @email"; SqlCommand selectCommand = new SqlCommand(selectStatement, connect); selectCommand.Parameters.AddWithValue("@email", email); Person person = PersonOperations.ReturnPerson(selectCommand, connect); return(person); } catch (Exception ex) { throw ex; } }
public static Person ReturnItem(Person person) { if (person.ID.ToString() == "") { person = null; return(person); } try { SqlConnection connect = RetaloDB.GetConnection(); string selectStatement = "Select *" + "FROM Person" + " Where PerID = @id"; SqlCommand selectCommand = new SqlCommand(selectStatement, connect); selectCommand.Parameters.AddWithValue("@id", person.ID); Person person2 = PersonOperations.ReturnPerson(selectCommand, connect); return(person2); } catch (Exception ex) { throw ex; } }