private void FillUsers()
        {
            UserGroups.Refresh();
            Userods.Refresh();
            SelectedGroupNum = 0;
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableSecurity", "Username"), 90);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Group"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Employee"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Provider"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Clinic"), 90);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;
            string    usertype = "all";

            if (comboUsers.SelectedIndex == 1)
            {
                usertype = "prov";
            }
            if (comboUsers.SelectedIndex == 2)
            {
                usertype = "emp";
            }
            if (comboUsers.SelectedIndex == 3)
            {
                usertype = "other";
            }
            int classNum = 0;

            if (comboSchoolClass.Visible && comboSchoolClass.SelectedIndex > 0)
            {
                classNum = SchoolClasses.List[comboSchoolClass.SelectedIndex - 1].SchoolClassNum;
            }
            table = Userods.RefreshSecurity(usertype, classNum);
            string userdesc;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                row      = new ODGridRow();
                userdesc = table.Rows[i]["UserName"].ToString();
                if (table.Rows[i]["IsHidden"].ToString() == "1")
                {
                    userdesc += Lan.g(this, "(hidden)");
                }
                row.Cells.Add(userdesc);
                row.Cells.Add(UserGroups.GetGroup(PIn.PInt(table.Rows[i]["UserGroupNum"].ToString())).Description);
                row.Cells.Add(Employees.GetNameFL(PIn.PInt(table.Rows[i]["EmployeeNum"].ToString())));
                row.Cells.Add(Providers.GetNameLF(PIn.PInt(table.Rows[i]["ProvNum"].ToString())));
                row.Cells.Add(Clinics.GetDesc(PIn.PInt(table.Rows[i]["ClinicNum"].ToString())));
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Beispiel #2
0
        private void FillUsers()
        {
            UserGroups.RefreshCache();
            Cache.Refresh(InvalidType.Security);
            SelectedGroupNum = 0;
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableSecurity", "Username"), 90);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Group"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Employee"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Provider"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Clinic"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "ClinicRestricted"), 100, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableSecurity", "Strong"), 80, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;
            string    usertype = "all";

            if (comboUsers.SelectedIndex == 1)
            {
                usertype = "prov";
            }
            if (comboUsers.SelectedIndex == 2)
            {
                usertype = "emp";
            }
            if (comboUsers.SelectedIndex == 3)
            {
                usertype = "other";
            }
            long classNum = 0;

            if (comboSchoolClass.Visible && comboSchoolClass.SelectedIndex > 0)
            {
                classNum = SchoolClasses.List[comboSchoolClass.SelectedIndex - 1].SchoolClassNum;
            }
            ListUser = Userods.RefreshSecurity(usertype, classNum);
            string userdesc;

            for (int i = 0; i < ListUser.Count; i++)
            {
                row      = new ODGridRow();
                userdesc = ListUser[i].UserName;
                if (ListUser[i].IsHidden)
                {
                    userdesc += Lan.g(this, "(hidden)");
                }
                row.Cells.Add(userdesc);
                row.Cells.Add(UserGroups.GetGroup(ListUser[i].UserGroupNum).Description);
                row.Cells.Add(Employees.GetNameFL(ListUser[i].EmployeeNum));
                row.Cells.Add(Providers.GetLongDesc(ListUser[i].ProvNum));
                row.Cells.Add(Clinics.GetDesc(ListUser[i].ClinicNum));
                row.Cells.Add(ListUser[i].ClinicIsRestricted?"X":"");
                row.Cells.Add(ListUser[i].PasswordIsStrong?"X":"");
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }