public async Task SubmitCreate(string model, int places, int carCap) { Model.PlaneType temp = new Model.PlaneType(); temp.Model = model; temp.Places = (places); temp.CarryCapacity = (carCap); await pts.Create(temp); this.Frame.Navigate(typeof(PlaneType)); }
public void Create() { this.planeType = new Model.PlaneType(); ColumnDefinition cd = new ColumnDefinition(); RowDefinition rd0 = new RowDefinition(); RowDefinition rd1 = new RowDefinition(); RowDefinition rd2 = new RowDefinition(); RowDefinition rd3 = new RowDefinition(); TextBox model = new TextBox(); model.Header = "Model"; //model.Width = 300; TextBox places = new TextBox(); places.Header = "Places"; //places.Width = 300; TextBox carCap = new TextBox(); carCap.Header = "Carry"; //carCap.Width = 300; Button submit = new Button { Name = "submit", Content = "Submit Create", Width = 150 }; submit.Margin = new Thickness(0, 10, 0, 10); submit.Click += async(sender, e) => await SubmitCreate(model.Text, Convert.ToInt32(places.Text), Convert.ToInt32(carCap.Text)); if (gr.Children.Count > 0) { gr.Children.Clear(); } gr.Children.Add(model); gr.Children.Add(places); gr.Children.Add(carCap); gr.Children.Add(submit); Grid.SetRow(model, 0); Grid.SetRow(places, 1); Grid.SetRow(carCap, 2); Grid.SetRow(submit, 3); }