예제 #1
0
        //
        //----------------------------tìm kiếm  ------------------------------------
        //
        private void bttk_Click(object sender, EventArgs e)
        {
            Button b = (Button)sender;

            string[] t = b.Text.Split('(');
            // grid_danhmuc.Rows.Clear();

            DataTable tb = new DataTable();

            for (int i = 0; i < tb_danhmuc.Columns.Count; i++)
            {
                tb.Columns.Add(tb_danhmuc.Columns[i].Caption);
            }
            for (int i = tb_danhmuc.Rows.Count - 1; i >= 0; i--)
            {
                if (string.Compare(t[0], tb_danhmuc.Rows[i][2].ToString(), true) == 0 ||
                    string.Compare(t[0], tb_danhmuc.Rows[i][3].ToString(), true) == 0 ||
                    string.Compare(t[0], tb_danhmuc.Rows[i][8].ToString(), true) == 0)
                {
                    DataRow dr = tb_danhmuc.Rows[i];
                    tb.Rows.Add(dr.ItemArray);
                }
            }

            F_NXMT.show_grid(grid_danhmuc, tb);
        }
예제 #2
0
        private void btNhap_Click_1(object sender, EventArgs e)
        {
            Button b = (Button)sender;

            tille_nx = b.Text;
            F_NXMT f = new F_NXMT();

            f.Show();
            f.Text = b.Text;
            //
            // danh sách các ngăn còn trống
            for (int i = 0; i < tb_hientai.Rows.Count; i++)
            {
                for (int j = 0; j < l_vitri.Count; j++)
                {
                    if (l_vitri[j] == tb_hientai.Rows[i][6].ToString().Trim())
                    {
                        l_vitri.RemoveAt(j);
                    }
                }
            }
        }