public void SetButtonEmpty(POSButtonMenu btn) { btn.Visibility = System.Windows.Visibility.Hidden; btn.Content = ""; btn.Image = null; btn.Background = System.Windows.Media.Brushes.Gray; btn.IsEnabled = false; }
private void SetFontGroup() { foreach (var item in gridGroup.Children) { POSButtonMenu btn = (POSButtonMenu)item; btn.FontSize = mCaiDatThucDon.NhomTextFontSize; btn.FontStyle = Data.SomeEnum.GetFontStyle(mCaiDatThucDon.NhomTextFontStyle); btn.FontWeight = Data.SomeEnum.GetFontWeight(mCaiDatThucDon.NhomTextFontWeights); } }
private void SetButtonLoaiNhom() { var listLoaiNhom = Data.BOLoaiNhom.GetAll(mTransit.KaraokeEntities, 2).ToList(); if (listLoaiNhom.Count > 0) { var ln1 = listLoaiNhom[0]; btnNuoc.Content = ln1.TenLoaiNhom; btnNuoc.Tag = ln1.LoaiNhomID; } if (listLoaiNhom.Count > 1) { var ln2 = listLoaiNhom[1]; btnThucAn.Content = ln2.TenLoaiNhom; btnThucAn.Tag = ln2.LoaiNhomID; } if (mCaiDatThucDon.LoaiNhomThucTatCaImages != null && mCaiDatThucDon.LoaiNhomThucTatCaImages.Length > 0) { btnTatCa.Image = Utilities.ImageHandler.BitmapImageFromByteArray(mCaiDatThucDon.LoaiNhomThucTatCaImages); } else { var uriSource = new Uri(@"/SystemImages;component/Images/All.jpg", UriKind.Relative); btnTatCa.Image = new BitmapImage(uriSource); } if (mCaiDatThucDon.LoaiNhomThucAnImages != null && mCaiDatThucDon.LoaiNhomThucAnImages.Length > 0) { btnThucAn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(mCaiDatThucDon.LoaiNhomThucAnImages); } else { var uriSource = new Uri(@"/SystemImages;component/Images/Food.jpg", UriKind.Relative); btnThucAn.Image = new BitmapImage(uriSource); } if (mCaiDatThucDon.LoaiNhomNuocImages != null && mCaiDatThucDon.LoaiNhomNuocImages.Length > 0) { btnNuoc.Image = Utilities.ImageHandler.BitmapImageFromByteArray(mCaiDatThucDon.LoaiNhomNuocImages); } else { var uriSource = new Uri(@"/SystemImages;component/Images/Drink.jpg", UriKind.Relative); btnNuoc.Image = new BitmapImage(uriSource); } foreach (var item in gridLoaiGroup.Children) { POSButtonMenu btn = (POSButtonMenu)item; btn.FontSize = mCaiDatThucDon.LoaiNhomTextFontSize; btn.FontStyle = Data.SomeEnum.GetFontStyle(mCaiDatThucDon.LoaiNhomTextFontStyle); btn.FontWeight = Data.SomeEnum.GetFontWeight(mCaiDatThucDon.LoaiNhomTextFontWeights); } }
private void btnGroup_Click(object sender, RoutedEventArgs e) { POSButtonMenu btn = (POSButtonMenu)sender; MenuNhomIndex = (Data.BOMenuNhom)btn.Tag; PageItems = 1; LoadMon(MenuNhomIndex.MenuNhom.NhomID); if (!_IsBanHang) { OnEventMenuNhom(MenuNhomIndex); } }
private void SetButtonKichThuocMon(POSButtonMenu btn, Data.BOMenuKichThuocMon item) { btn.Visibility = System.Windows.Visibility.Visible; btn.Tag = item; btn.IsEnabled = true; btn.Content = item.MenuKichThuocMon.TenLoaiBan; if (item.MenuMon.Hinh != null && item.MenuMon.Hinh.Length > 0) { btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(item.MenuMon.Hinh); } else { var uriSource = new Uri(@"/SystemImages;component/Images/NoImages.jpg", UriKind.Relative); btn.Image = new BitmapImage(uriSource); } }
public void SetButtonNhom(POSButtonMenu btn, Data.BOMenuNhom item) { btn.Visibility = System.Windows.Visibility.Visible; btn.Tag = item; btn.IsEnabled = true; btn.Content = item.MenuNhom.TenNgan; if (item.MenuNhom.Hinh != null && item.MenuNhom.Hinh.Length > 0) { btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(item.MenuNhom.Hinh); } else { if (mCaiDatThucDon.NhomImages != null && mCaiDatThucDon.NhomImages.Length > 0) { btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(mCaiDatThucDon.NhomImages); } else { var uriSource = new Uri(@"/SystemImages;component/Images/NoImages.jpg", UriKind.Relative); btn.Image = new BitmapImage(uriSource); } } }
private void btnItems_Click(object sender, RoutedEventArgs e) { POSButtonMenu btn = (POSButtonMenu)sender; if (btn.Tag is Data.BOMenuMon) { MenuMonIndex = (Data.BOMenuMon)btn.Tag; if (_IsBanHang) { PageKichThuocMon = 1; LoadKichThuocMon(MenuMonIndex); } else { OnEventMenuMon(MenuMonIndex); } } else if (btn.Tag is Data.BOMenuKichThuocMon) { MenuKichThuocMonIndex = (Data.BOMenuKichThuocMon)btn.Tag; OnEventMenuKichThuocMon(MenuKichThuocMonIndex); } }