Beispiel #1
0
 public static Band GetBands(string p)
 {
     Band band = new Band();
     DbDataReader reader = Database.GetData("SELECT * FROM tbl_bands WHERE ID=@id",
         Database.AddParameter("@id", Convert.ToInt32(p))
         );
     foreach (IDataRecord db in reader)
     {
         band=Create(db);
     }
     reader.Close();
     return band;
 }
Beispiel #2
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="navigationParameter">The parameter value passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested.
 /// </param>
 /// <param name="pageState">A dictionary of state preserved by this page during an earlier
 /// session.  This will be null the first time a page is visited.</param>
 protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
 {
     // Allow saved page state to override the initial item to display
     if (pageState != null && pageState.ContainsKey("SelectedItem"))
     {
         navigationParameter = pageState["SelectedItem"];
     }
     //this.DefaultViewModel["Group"] = navigationParameter.Group;
     //this.DefaultViewModel["Items"] = blist;
     //this.flipView.SelectedItem = (Band)navigationParameter;
     //var item = SampleDataSource.GetItem((String)navigationParameter);
     //this.DefaultViewModel["Group"] = item.Group;
     //this.DefaultViewModel["Items"] = item.Group.Items;
     //this.flipView.SelectedItem = item;
     // TODO: Assign a bindable group to this.DefaultViewModel["Group"]
     // TODO: Assign a collection of bindable items to this.DefaultViewModel["Items"]
     // TODO: Assign the selected item to this.flipView.SelectedItem
     Bandform =(Band)navigationParameter;
     this.DefaultViewModel["BandImage"] = Bandform.Picture;
     txtNaam.Text = Bandform.Name;
     txtDesc.Text = Bandform.Description;
 }