public CoTravelerModel CreateCoTravelerModel(CoTraveler coTraveler) { return new CoTravelerModel() { CoTravelerId = coTraveler.CoTravelerId, Name = coTraveler.Name, Relationship = coTraveler.Relationship, UserId = coTraveler.UserId, message = "success" }; }
private void buttonCoTravelerInsert_Click(object sender, EventArgs e) { using (var db = new GIIContext()) { GIIRepository repo = new GIIRepository(db); int userId = Convert.ToInt32(textBoxUser_CO_Id.Text); CoTraveler co = new CoTraveler() { Name = textBoxCoName.Text, Relationship = textBoxCo_Relationship.Text, UserId = Convert.ToInt32(textBoxUser_CO_Id.Text) }; repo.AddCoTraveler(co); repo.SaveAll(); } }