private void Window_Loaded(object sender, RoutedEventArgs e) { cbbFontStyles.ItemsSource = Data.SomeEnum.GetFontStyles(); if (cbbFontStyles.Items.Count > 0) { cbbFontStyles.SelectedIndex = 0; } cbbFontWeight.ItemsSource = Data.SomeEnum.GetFontWeights(); if (cbbFontStyles.Items.Count > 0) { cbbFontStyles.SelectedIndex = 0; } _Item = BOCaiDatBan.GetAll(mTransit); if (_Item != null) { txtFontSize.Text = _Item.TableFontSize.ToString(); cbbFontStyles.SelectedValue = _Item.TableFontStyle; cbbFontWeight.SelectedValue = _Item.TableFontWeights; if (_Item.TableImage != null && _Item.TableImage.Length > 0) { btnHinh.Image = Utilities.ImageHandler.BitmapImageFromByteArray(_Item.TableImage); } } }
public void TableDraw(Data.CAIDATBAN caidat) { double x = mGrid.RenderSize.Width * (double)_Ban.LocationX; double y = mGrid.RenderSize.Height * (double)_Ban.LocationY; double width = mGrid.RenderSize.Width * (double)_Ban.Width; double height = mGrid.RenderSize.Height * (double)_Ban.Height; //double x = _WidthFrame * (double)_Ban.LocationX; //double y = _HeightFrame * (double)_Ban.LocationY; //double width = _WidthFrame * (double)_Ban.Width; //double height = _HeightFrame * (double)_Ban.Height; this.FontSize = caidat.TableFontSize; this.FontStyle = Data.SomeEnum.GetFontStyle(caidat.TableFontStyle); this.FontWeight = Data.SomeEnum.GetFontWeight(caidat.TableFontWeights); this.Width = width > 2? width - 2:0; this.Height = height > 2? height - 2:0; this.Margin = new Thickness( x, y, mGrid.RenderSize.Width - width - x, mGrid.RenderSize.Height - height - y ); this.Content = _Ban.TenBan; if (_Ban.Hinh != null && _Ban.Hinh.Length > 0) { this.Image = Utilities.ImageHandler.BitmapImageFromByteArray(_Ban.Hinh); } else { if (caidat.TableImage != null && caidat.TableImage.Length > 0) { this.Image = Utilities.ImageHandler.BitmapImageFromByteArray(caidat.TableImage); } else { var uriSource = new Uri(@"/ControlLibrary;component/Images/NoImages.jpg", UriKind.Relative); this.Image = new BitmapImage(uriSource); } //var uriSource = new Uri(@"/ControlLibrary;component/Images/NoImages.jpg", UriKind.Relative); //this.Image = new BitmapImage(uriSource); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { cbbFontStyles.ItemsSource = Data.SomeEnum.GetFontStyles(); if (cbbFontStyles.Items.Count > 0) cbbFontStyles.SelectedIndex = 0; cbbFontWeight.ItemsSource = Data.SomeEnum.GetFontWeights(); if (cbbFontStyles.Items.Count > 0) cbbFontStyles.SelectedIndex = 0; _Item = BOCaiDatBan.GetAll(mTransit); if (_Item != null) { txtFontSize.Text = _Item.TableFontSize.ToString(); cbbFontStyles.SelectedValue = _Item.TableFontStyle; cbbFontWeight.SelectedValue = _Item.TableFontWeights; if (_Item.TableImage != null && _Item.TableImage.Length > 0) { btnHinh.Image = Utilities.ImageHandler.BitmapImageFromByteArray(_Item.TableImage); } } }
public void CapNhat(Data.CAIDATBAN item, Data.Transit transit) { fr.Update(item); fr.Commit(); }