Пример #1
0
        private void dgvDanhSach_Click(object sender, EventArgs e)
        {
            String id = dgvDanhSach.SelectedRows[0].Cells["ID"].Value.ToString();
            CLuat  cl = new CLuat();
            MLuat  ml = cl.GetByID(id);

            if (ml != null)
            {
                for (int i = 0; i < clbVeTrai.Items.Count; i++)
                {
                    clbVeTrai.SetItemChecked(i, false);
                }
                tbTenLuat.Text          = ml.Name;
                tbMoTaLuat.Text         = ml.Description;
                cbbVePhai.SelectedValue = ml.RightID.ToString();
                List <MChiTietLuat> veTrai = ml.ChiTietLuat();
                if (veTrai != null && veTrai.Count > 0)
                {
                    foreach (MChiTietLuat ct in veTrai)
                    {
                        for (int i = 0; i < clbVeTrai.Items.Count; i++)
                        {
                            if (IDList[i].Equals(ct.LeftID.ToString()))
                            {
                                clbVeTrai.SetItemChecked(i, true);
                                break;
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        public MLuat Luat()
        {
            CLuat cLuat = new CLuat();

            return(cLuat.GetByID(RuleID.ToString()));
        }