Exemplo n.º 1
0
func (t Testimonial) PopulateTestimonial(row mysql.Row, res mysql.Result, ch chan Testimonial) {
	testimonial := Testimonial{
		ID:        row.Int(res.Map("testimonialID")),
		Rating:    row.Float(res.Map("rating")),
		Title:     row.Str(res.Map("title")),
		Content:   row.Str(res.Map("testimonial")),
		DateAdded: row.Time(res.Map("dateAdded"), UTC),
		Approved:  row.Bool(res.Map("approved")),
		Active:    row.Bool(res.Map("active")),
		FirstName: row.Str(res.Map("first_name")),
		LastName:  row.Str(res.Map("last_name")),
		Location:  row.Str(res.Map("location")),
	}
	ch <- testimonial
}
Exemplo n.º 2
0
func (c CustomerLocation) PopulateLocation(row mysql.Row, res mysql.Result, ch chan CustomerLocation) {
	location := CustomerLocation{
		ID:              row.Int(res.Map("locationID")),
		CustomerID:      row.Int(res.Map("cust_id")),
		Name:            row.Str(res.Map("name")),
		Address:         row.Str(res.Map("address")),
		City:            row.Str(res.Map("city")),
		StateID:         row.Int(res.Map("stateID")),
		PostalCode:      row.Str(res.Map("postalCode")),
		Email:           row.Str(res.Map("email")),
		Phone:           row.Str(res.Map("phone")),
		Fax:             row.Str(res.Map("fax")),
		Latitude:        row.Float(res.Map("latitude")),
		Longitude:       row.Float(res.Map("longitude")),
		ContactPerson:   row.Str(res.Map("contact_person")),
		IsPrimary:       row.Bool(res.Map("isprimary")),
		ShippingDefault: row.Bool(res.Map("ShippingDefault")),
	}
	ch <- location
}