示例#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
        public void LoadForm()
        {
            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];
                }
            }

            cbbChiTietTK.Properties.Items.Clear();
            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();
                }
            }
        }
示例#3
0
        private void Form_ThemMonAn_Load(object sender, EventArgs e)
        {
            cbbLoaiMonAn.Properties.Items.Clear();
            // cbbNhaHang.Properties.Items.Clear();
            DataTable dt = MonAn_BUS.LayLoaiMon();

            if (dt.Rows.Count > 0)
            {
                ArrayMaMon = new string[dt.Rows.Count];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dt.Rows[i];
                    cbbLoaiMonAn.Properties.Items.Add(dr[1]);
                    ArrayMaMon[i] = dr[0].ToString();
                }
            }
            //DataTable dt1 = MonAn_BUS.LayNhaHang();
            //if (dt1.Rows.Count > 0)
            //{
            //    ArrayMaNH = new string[dt1.Rows.Count];
            //    for (int i = 0; i < dt1.Rows.Count; i++)
            //    {
            //        DataRow dr = dt1.Rows[i];
            //        cbbNhaHang.Properties.Items.Add(dr[1]);
            //        ArrayMaNH[i] = dr[0].ToString();
            //    }
            //}
        }