Exemplo n.º 1
0
        private void SetRight()
        {
            try
            {
                c_row_select = dgrUser.SelectedIndex;

                User_Rights frmUser_Rights = new User_Rights();
                frmUser_Rights.Owner = Window.GetWindow(this);

                User_Info _us = new User_Info();
                _us = (User_Info)dgrUser.SelectedItem;
                if (_us != null)
                {
                    frmUser_Rights.c_UsersInfo = _us;
                    frmUser_Rights.ShowDialog();

                    DataGridHelper.NVSFocus(dgrUser, c_row_select, 1);
                }
                else
                {
                    NoteBox.Show("Bạn chưa chọn user để set quyền", "Thông báo", NoteBoxLevel.Error);
                    DataGridHelper.NVSFocus(dgrUser, 0, 1);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void btnPhanQuyen_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                User_Info ms = new User_Info();
                ms = (User_Info)dgrUser.SelectedItem;

                c_row_select = dgrUser.SelectedIndex;
                if (ms != null)
                {
                    User_Rights frm_GroupUser_Right = new User_Rights();
                    frm_GroupUser_Right.Owner       = Window.GetWindow(this);
                    frm_GroupUser_Right.c_UsersInfo = ms;
                    frm_GroupUser_Right.ShowDialog();
                    if (frm_GroupUser_Right.c_ok == 1)
                    {
                        DataGridHelper.NVSFocus(dgrUser, c_row_select, 1);
                        frm_GroupUser_Right.c_ok = 0;
                    }
                    else
                    {
                        DataGridHelper.NVSFocus(dgrUser, c_row_select, 1);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }