Пример #1
0
        private void gvKhoVai_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            // Sửa
            if (e.ColumnIndex == 0)
            {
                string _id_rowindex = gvKhoVai.Rows[e.RowIndex].Cells[2].Value.ToString();
                _id_rowindex += "_" + e.RowIndex;
                var thongtin = new ttKhoVai(_id_rowindex, this);
                thongtin.ShowDialog();
            }

            // Xóa
            if (e.ColumnIndex == 1)
            {
                string _id = gvKhoVai.Rows[e.RowIndex].Cells[2].Value.ToString();
                DialogResult dr = MessageBox.Show("Bạn có muốn xóa Khổ Vải này không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (dr == DialogResult.Yes)
                {
                    DA.Del_KhoVai(new string[] { _id });
                    LoadGrid();
                }
            }
        }
Пример #2
0
 private void btThem_Click(object sender, EventArgs e)
 {
     var thongtin = new ttKhoVai("", this);
     thongtin.ShowDialog();
 }