예제 #1
0
        private void BtnSua_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            lc = new fLuaChon(2);
            DialogResult rs = lc.ShowDialog();

            if (rs == DialogResult.OK)//Vai trò
            {
                string _ID          = gvPermision.GetFocusedRowCellValue("ID").ToString();
                string _Name        = gvPermision.GetFocusedRowCellValue("Name").ToString();
                string _Description = gvPermision.GetFocusedRowCellValue("Description").ToString();
                bool   _ACTIVE      = bool.Parse(gvPermision.GetFocusedRowCellValue("ACTIVE").ToString());
                CQuyen q            = new CQuyen
                                      (
                    _ID,
                    _Name,
                    _Description,
                    _ACTIVE
                                      );

                fSuaVaiTro vt = new fSuaVaiTro(false, q);
                vt.ShowDialog();
                return;
            }
            else if (rs == DialogResult.Yes)//Người dùng
            {
                string _UserID      = gvUser.GetFocusedRowCellValue("UserID").ToString();
                string _UserName    = gvUser.GetFocusedRowCellValue("UserName").ToString();
                string _Password    = gvUser.GetFocusedRowCellValue("Password").ToString();
                string _GroupID     = gvUser.GetFocusedRowCellValue("Group_ID").ToString();
                string _Description = gvUser.GetFocusedRowCellValue("Description").ToString();
                string _PartID      = gvUser.GetFocusedRowCellValue("PartID").ToString();
                bool   _Active      = bool.Parse(gvUser.GetFocusedRowCellValue("Active").ToString());

                CUser us = new CUser
                           (
                    _UserID,
                    _UserName,
                    _Password,
                    _GroupID,
                    _Description,
                    _PartID,
                    _Active
                           );
                fSuaNguoiDung nd = new fSuaNguoiDung(false, us);
                nd.ShowDialog();
                return;
            }
        }
예제 #2
0
        private void BtnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            lc = new fLuaChon(3);
            DialogResult rs = lc.ShowDialog();

            if (rs == DialogResult.OK)//Vai trò
            {
                fSuaVaiTro vt = new fSuaVaiTro(true);
                vt.ShowDialog();
                return;
            }
            else if (rs == DialogResult.Yes)//Người dùng
            {
                fSuaNguoiDung nd = new fSuaNguoiDung(true);
                nd.ShowDialog();
                return;
            }
        }