示例#1
0
 private void OnEventMenuMon(Data.BOMenuMon item)
 {
     if (_OnEventMenuMon != null)
     {
         _OnEventMenuMon(item);
     }
 }
 public void Init(Data.BOMenuMon mon)
 {
     if (OnEventExit == null)
         btnHuy.Visibility = System.Windows.Visibility.Hidden;
     BOMenuKichThuocMon = new Data.BOMenuKichThuocMon(mTransit);
     mMon = mon;
     btnDanhSachGia.Visibility = System.Windows.Visibility.Hidden;
 }
示例#3
0
 public WindowMenuSetMayIn(Data.BOMenuMon mon, Data.Transit transit)
 {
     InitializeComponent();
     mTransit = transit;
     uCMenuSetMayIn.OnEventExit += new UCMenuSetMayIn.OnExit(uCMenuSetMayIn_OnEventExit);
     uCMenuSetMayIn.Init(mTransit);
     uCMenuSetMayIn.SetValues(mon);
 }
 void uCMenu__OnEventMenuMon(Data.BOMenuMon ob)
 {
     if (IsMon)
     {
         _ItemMon = ob;
         DialogResult = true;
     }
 }
示例#5
0
 void uCMenu__OnEventMenuMon(Data.BOMenuMon ob)
 {
     if (IsMon)
     {
         _ItemMon     = ob;
         DialogResult = true;
     }
 }
 public void SetValues(Data.BOMenuMon mon)
 {
     _Mon = mon;
     if (_Mon != null)
     {
         txtTenMon.Text = _Mon.MenuMon.TenDai;
         LoadDanhSach();
     }
 }
示例#7
0
 public void SetValues(Data.BOMenuMon mon)
 {
     _Mon = mon;
     if (_Mon != null)
     {
         txtTenMon.Text = _Mon.MenuMon.TenDai;
         LoadDanhSach();
     }
 }
 public WindowDanhSachBan(Data.BOMenuMon mon, Data.Transit transit)
 {
     InitializeComponent();
     mTransit = transit;
     mMon = mon;
     uCDanhSachBanList.OnEventExit += new UCDanhSachBanList.OnExit(uCDanhSachBanList_OnEventExit);
     uCDanhSachBanList.SetTransit(mTransit);
     uCDanhSachBanList.Init(mMon);
 }
 public WindowDanhSachBan(Data.BOMenuMon mon, Data.Transit transit)
 {
     InitializeComponent();
     mTransit = transit;
     mMon     = mon;
     uCDanhSachBanList.OnEventExit += new UCDanhSachBanList.OnExit(uCDanhSachBanList_OnEventExit);
     uCDanhSachBanList.SetTransit(mTransit);
     uCDanhSachBanList.Init(mMon);
 }
 public void Init(Data.BOMenuMon mon)
 {
     if (OnEventExit == null)
     {
         btnHuy.Visibility = System.Windows.Visibility.Hidden;
     }
     BOMenuKichThuocMon = new Data.BOMenuKichThuocMon(mTransit);
     mMon = mon;
     btnDanhSachGia.Visibility = System.Windows.Visibility.Hidden;
 }
示例#11
0
 public UCNewMon(Data.MENUNHOM menuNhom, Data.Transit transit, Data.BOMenuMon bOMenuMon)
 {
     InitializeComponent();
     mMenuNhom = menuNhom;
     mTransit  = transit;
     btnHinhAnh.SetTransit(transit);
     BOMenuMon       = bOMenuMon;
     BOMenuItemMayIn = new Data.BOMenuItemMayIn();
     PhanQuyen();
 }
示例#12
0
 public UCNewMon(Data.MENUNHOM menuNhom, Data.Transit transit, Data.BOMenuMon bOMenuMon)
 {
     InitializeComponent();
     mMenuNhom = menuNhom;
     mTransit = transit;
     btnHinhAnh.SetTransit(transit);
     BOMenuMon = bOMenuMon;
     BOMenuItemMayIn = new Data.BOMenuItemMayIn();
     PhanQuyen();
 }
示例#13
0
 private void GetValues()
 {
     if (_Mon == null)
     {
         _Mon = new Data.BOMenuMon();
         _Mon.MenuMon.Deleted = false;
         _Mon.MenuMon.NhomID  = mMenuNhom.NhomID;
     }
     _Mon.MenuMon.TenDai  = txtTenDai.Text;
     _Mon.MenuMon.TenNgan = txtTenNgan.Text;
     _Mon.MenuMon.DonViID = (int)cbbKieuBan.SelectedValue;
     _Mon.MenuMon.MaVach  = txtMaVach.Text;
     if (mBitmapImage != null)
     {
         BitmapFrame img = Utilities.ImageHandler.CreateResizedImage(mBitmapImage, 120, 90, 0);
         _Mon.MenuMon.Hinh = Utilities.ImageHandler.ImageToByte(img);
     }
     if (txtGiaMacDinh.Text == "")
     {
         _Mon.MenuMon.Gia = 0;
     }
     else
     {
         _Mon.MenuMon.Gia = Utilities.MoneyFormat.ConvertToDecimal(txtGiaMacDinh.Text);
     }
     if (txtSapXep.Text == "")
     {
         _Mon.MenuMon.SapXep = 0;
     }
     else
     {
         _Mon.MenuMon.SapXep = Convert.ToInt32(txtSapXep.Text.Trim());
     }
     if (txtTonKhoToiDa.Text == "")
     {
         _Mon.MenuMon.SapXep = 0;
     }
     else
     {
         _Mon.MenuMon.TonKhoToiDa = Convert.ToInt32(txtTonKhoToiDa.Text.Trim());
     }
     if (txtTonKhoToiThieu.Text == "")
     {
         _Mon.MenuMon.SapXep = 0;
     }
     else
     {
         _Mon.MenuMon.TonKhoToiThieu = Convert.ToInt32(txtTonKhoToiThieu.Text.Trim());
     }
     _Mon.MenuMon.Visual = (bool)ckBan.IsChecked;
 }
示例#14
0
 public void SetTransit(Data.Transit transit)
 {
     SetImageSizetItems();
     mTransit = transit;
     BOMenuMon = new Data.BOMenuMon(transit);
     BOMenuNhom = new Data.BOMenuNhom(transit);
     BOMenuKichThuocMon = new Data.BOMenuKichThuocMon(transit);
     BOMenuKhuyenMai = new Data.BOMenuKhuyenMai();
     mCaiDatThucDon = Data.BOCaiDatThucDon.GetQueryNoTracking(mTransit);
     SetButtonLoaiNhom();
     SetFontItem();
     SetFontGroup();
     LoadData();
 }
示例#15
0
 public void SetTransit(Data.Transit transit)
 {
     SetImageSizetItems();
     mTransit           = transit;
     BOMenuMon          = new Data.BOMenuMon(transit);
     BOMenuNhom         = new Data.BOMenuNhom(transit);
     BOMenuKichThuocMon = new Data.BOMenuKichThuocMon(transit);
     BOMenuKhuyenMai    = new Data.BOMenuKhuyenMai();
     mCaiDatThucDon     = Data.BOCaiDatThucDon.GetQueryNoTracking(mTransit);
     SetButtonLoaiNhom();
     SetFontItem();
     SetFontGroup();
     LoadData();
 }
 void uCMenu__OnEventMenuMon(Data.BOMenuMon ob)
 {
     UserControlLibrary.UCNewMon uc = new UserControlLibrary.UCNewMon(mMenuNhom, mTransit, uCMenu.BOMenuMon);
     uc._Mon = (Data.BOMenuMon)ob;
     svChinhSuaMenu.Children.Clear();
     svChinhSuaMenu.Children.Add(uc);
     btnCapNhat.Content    = "Cập nhật món";
     btnXoa.Content        = "Xóa món";
     btnCapNhat.Visibility = System.Windows.Visibility.Visible;
     btnXoa.Visibility     = System.Windows.Visibility.Visible;
     if (lbStatus.Tag != null)
     {
         lbStatus.Text = lbStatus.Tag.ToString();
     }
     lbStatus.Tag = "";
 }
示例#17
0
 private void SetButtonItem(POSButtonMenu btn, Data.BOMenuMon item)
 {
     btn.Visibility = System.Windows.Visibility.Visible;
     btn.Tag        = item;
     btn.IsEnabled  = true;
     btn.Content    = item.MenuMon.TenNgan;
     if (item.MenuMon.Hinh != null && item.MenuMon.Hinh.Length > 0)
     {
         btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(item.MenuMon.Hinh);
     }
     else
     {
         if (mCaiDatThucDon.MonImages != null && mCaiDatThucDon.MonImages.Length > 0)
         {
             btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(mCaiDatThucDon.MonImages);
         }
         else
         {
             var uriSource = new Uri(@"/SystemImages;component/Images/NoImages.jpg", UriKind.Relative);
             btn.Image = new BitmapImage(uriSource);
         }
     }
 }
示例#18
0
        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);
            }
        }
示例#19
0
 private void GetValues()
 {
     if (_Mon == null)
     {
         _Mon = new Data.BOMenuMon();
         _Mon.MenuMon.Deleted = false;
         _Mon.MenuMon.NhomID = mMenuNhom.NhomID;
     }
     _Mon.MenuMon.TenDai = txtTenDai.Text;
     _Mon.MenuMon.TenNgan = txtTenNgan.Text;
     _Mon.MenuMon.DonViID = (int)cbbKieuBan.SelectedValue;
     _Mon.MenuMon.MaVach = txtMaVach.Text;
     if (mBitmapImage != null)
     {
         BitmapFrame img = Utilities.ImageHandler.CreateResizedImage(mBitmapImage, 120, 90, 0);
         _Mon.MenuMon.Hinh = Utilities.ImageHandler.ImageToByte(img);
     }
     if (txtGiaMacDinh.Text == "")
         _Mon.MenuMon.Gia = 0;
     else
         _Mon.MenuMon.Gia = Utilities.MoneyFormat.ConvertToDecimal(txtGiaMacDinh.Text);
     if (txtSapXep.Text == "")
         _Mon.MenuMon.SapXep = 0;
     else
         _Mon.MenuMon.SapXep = Convert.ToInt32(txtSapXep.Text.Trim());
     if (txtTonKhoToiDa.Text == "")
         _Mon.MenuMon.SapXep = 0;
     else
         _Mon.MenuMon.TonKhoToiDa = Convert.ToInt32(txtTonKhoToiDa.Text.Trim());
     if (txtTonKhoToiThieu.Text == "")
         _Mon.MenuMon.SapXep = 0;
     else
         _Mon.MenuMon.TonKhoToiThieu = Convert.ToInt32(txtTonKhoToiThieu.Text.Trim());
     _Mon.MenuMon.Visual = (bool)ckBan.IsChecked;
 }
示例#20
0
 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);
     }
 }
 public WindowThemDanhSachBan(Data.BOMenuMon mon, Data.Transit transit)
 {
     InitializeComponent();
     mTransit = transit;
     mMon = mon;
 }
 void uCMenu__OnEventMenuMon(Data.BOMenuMon ob)
 {
     uCDanhSachBanList.Init(ob);
     uCDanhSachBanList.LoadDanhSach();
 }
 void UCMenu__OnEventMenuMon(Data.BOMenuMon ob)
 {
     _Mon = ob;
     uCMenuSetMayIn.SetValues(_Mon);
 }
示例#24
0
 public WindowThemDanhSachBan(Data.BOMenuMon mon, Data.Transit transit)
 {
     InitializeComponent();
     mTransit = transit;
     mMon     = mon;
 }
示例#25
0
 public void LoadKichThuocMon(Data.BOMenuMon mon)
 {
     lsMenuKichThuocMon = BOMenuKichThuocMon.GetAll(mon.MenuMon.MonID, _IsSoLuongChoPhepTonKho, _IsSoLuongKhongChoPhepTonKho, mTransit).ToList();
     if (lsMenuKichThuocMon.Count == 1)
     {
         OnEventMenuKichThuocMon(lsMenuKichThuocMon[0]);
     }
     else if (lsMenuKichThuocMon.Count > gridItems.Children.Count)
     {
         int SoLuongKichThuocMon = gridItems.Children.Count - 2;
         List <Data.BOMenuKichThuocMon> lsKichThuocMonTem = lsMenuKichThuocMon.Skip((PageKichThuocMon - 1) * SoLuongKichThuocMon).Take(SoLuongKichThuocMon).ToList();
         bool Chay = true;
         int  j    = 0;
         for (int i = 0; i < lsKichThuocMonTem.Count; i++, j++)
         {
             if (i == 0)
             {
                 if (IsRefershMenu)
                 {
                     OnEventMenuKichThuocMon(lsMenuKichThuocMon[i]);
                 }
             }
             Chay = true;
             while (Chay)
             {
                 Chay = false;
                 if (Grid.GetRow(gridItems.Children[j]) != gridItems.RowDefinitions.Count - 1)
                 {
                     SetButtonKichThuocMon((POSButtonMenu)gridItems.Children[j], lsKichThuocMonTem[i]);
                 }
                 else if (Grid.GetColumn(gridItems.Children[j]) > 0 && Grid.GetColumn(gridItems.Children[j]) < gridItems.ColumnDefinitions.Count - 1)
                 {
                     SetButtonKichThuocMon((POSButtonMenu)gridItems.Children[j], lsKichThuocMonTem[i]);
                 }
                 else
                 {
                     Chay = true;
                     j++;
                 }
             }
         }
         if (lsKichThuocMonTem.Count > gridItems.Children.Count - gridItems.ColumnDefinitions.Count)
         {
             j++;
         }
         Chay = true;
         for (; j < gridItems.Children.Count; j++)
         {
             Chay = true;
             while (Chay)
             {
                 Chay = false;
                 if (Grid.GetRow(gridItems.Children[j]) != gridItems.RowDefinitions.Count - 1)
                 {
                     SetButtonEmpty((POSButtonMenu)gridItems.Children[j]);
                 }
                 else if (Grid.GetColumn(gridItems.Children[j]) > 0 && Grid.GetColumn(gridItems.Children[j]) < gridItems.ColumnDefinitions.Count - 1)
                 {
                     SetButtonEmpty((POSButtonMenu)gridItems.Children[j]);
                 }
                 else
                 {
                     Chay = true;
                     j++;
                     if (j > gridItems.Children.Count - 1)
                     {
                         Chay = false;
                     }
                 }
             }
         }
         SetItemPage(LoaiMenu.KichThuocMon);
     }
     else
     {
         for (int i = 0; i < lsMenuKichThuocMon.Count; i++)
         {
             if (i == 0)
             {
                 if (IsRefershMenu)
                 {
                     OnEventMenuKichThuocMon(lsMenuKichThuocMon[i]);
                 }
             }
             SetButtonKichThuocMon((POSButtonMenu)gridItems.Children[i], lsMenuKichThuocMon[i]);
         }
         for (int i = lsMenuKichThuocMon.Count; i < gridItems.Children.Count; i++)
         {
             SetButtonEmpty((POSButtonMenu)gridItems.Children[i]);
         }
         SetItemPage(LoaiMenu.None);
     }
 }