Example #1
0
        private void frmGoiMon_Load(object sender, EventArgs e)
        {
            listChiTietHoaDon.Clear();
            lblTenBan.Text = DAO_GoiMon.TenBan(IDBan);
            DataTable danhsachhanghoa = BUS_HangHoa.DSHangHoa_Full();

            cmbHangHoa.Properties.DataSource    = danhsachhanghoa;
            cmbHangHoa.Properties.ValueMember   = "ID";
            cmbHangHoa.Properties.DisplayMember = "TenHangHoa";
        }
Example #2
0
 public void DanhSachMonAnBanChay()
 {
     tblTableMonAn.Controls.Clear();
     if (txtTimKiem.Text == "")
     {
         DataTable db = BUS_HangHoa.DSHangHoa_Full(frmDangNhap.NguoiDung.Idchinhanh);
         if (db.Rows.Count > 0)
         {
             foreach (DataRow dr in db.Rows)
             {
                 SimpleButton btn = new SimpleButton();
                 btn.Width  = 108;
                 btn.Height = 60;
                 btn.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
                 btn.Text            = dr["TenHangHoa"].ToString();
                 btn.Click          += btn_Click;
                 btn.KeyDown        += btn_KeyDown;
                 btn.Tag             = dr["ID"].ToString();
                 btn.Appearance.Font = new Font("Tahoma", 11);
                 btn.ForeColor       = Color.Black;
                 btn.StyleController = null;
                 btn.LookAndFeel.UseDefaultLookAndFeel = false;
                 tblTableMonAn.Controls.Add(btn);
             }
         }
     }
     else
     {
         DataTable db = BUS_HangHoa.DSHangHoaTimKiem(txtTimKiem.Text.ToString(), frmDangNhap.NguoiDung.Idchinhanh);
         if (db.Rows.Count > 0)
         {
             foreach (DataRow dr in db.Rows)
             {
                 SimpleButton btn = new SimpleButton();
                 btn.Width  = 108;
                 btn.Height = 60;
                 btn.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
                 btn.Text            = dr["TenHangHoa"].ToString();
                 btn.Click          += btn_Click;
                 btn.KeyDown        += btn_KeyDown;
                 btn.Tag             = dr["ID"].ToString();
                 btn.Appearance.Font = new Font("Tahoma", 11);
                 btn.ForeColor       = Color.Black;
                 btn.StyleController = null;
                 btn.LookAndFeel.UseDefaultLookAndFeel = false;
                 tblTableMonAn.Controls.Add(btn);
             }
         }
     }
 }