예제 #1
0
        private void UCtrl_QLNhaHang_QLThucDon_Load(object sender, EventArgs e)
        {
            gridLoaiMonAn.DataSource = LoaiMonAn_BUS.DocLoaiMonAn();

            gridMonAn.DataSource = MonAn_BUS.DocMonAn(mode, maNH);


            DataTable dt = MonAn_BUS.DocMonAn(mode, maNH);

            if (dt.Rows.Count > 0)
            {
                ArrayMaMon = new int[dt.Rows.Count];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dt.Rows[i];
                    ArrayMaMon[i] = (int)dr[0];
                }
            }

            DataTable dt1 = MonAn_BUS.LayLoaiMon();

            if (dt1.Rows.Count > 0)
            {
                ArrayLoaiMon = new string[dt.Rows.Count];
                for (int i = 0; i < dt1.Rows.Count; i++)
                {
                    DataRow dr = dt1.Rows[i];
                    cbbChiTietTK.Properties.Items.Add(dr[1]);
                    ArrayLoaiMon[i] = dr[0].ToString();
                }
            }
        }
예제 #2
0
        private void ThemLoaiMonAn()
        {
            Form_ThemLoaiMonAn openForm = new Form_ThemLoaiMonAn();

            openForm.Mode = mode;
            if (openForm.ShowDialog() == DialogResult.OK)
            {
                LoaiMonAn_BUS.ThemLoaiMonAn(openForm.loaiMonAn);
                gridLoaiMonAn.DataSource = LoaiMonAn_BUS.DocLoaiMonAn();
            }
        }
예제 #3
0
        private void frmThemMonAn_Load(object sender, EventArgs e)
        {
            dtLoaiMonAn = LoaiMonAn_BUS.DocLoaiMonAn();
            ComboBoxItemCollection coll = cboLoaiMonAn.Properties.Items;

            coll.BeginUpdate();

            foreach (DataRow row in dtLoaiMonAn.Rows)
            {
                coll.Add((String)row.ItemArray[1]);
                coll.EndUpdate();
            }
            //cboLoaiMonAn.SelectedIndex = 0;

            dtMonAn     = new DataTable();
            dtMonAnChon = new DataTable();

            dtMonAnChon.Columns.Add("MaMon", System.Type.GetType("System.Int32"));
            dtMonAnChon.Columns.Add("TenMon", System.Type.GetType("System.String"));
            dtMonAnChon.Columns.Add("DonViTinh", System.Type.GetType("System.String"));
            dtMonAnChon.Columns.Add("SoLuong", System.Type.GetType("System.Int32"));
            dtMonAnChon.Columns.Add("Gia", System.Type.GetType("System.Double"));
        }
예제 #4
0
 private void btnXoaLoaiMA_Click(object sender, EventArgs e)
 {
     XoaLoaiMonAn();
     gridLoaiMonAn.DataSource = LoaiMonAn_BUS.DocLoaiMonAn();
 }