Exemple #1
0
        public Collection <ListItem> GetAccounts()
        {
            if (Switches.AllowParentAccountInGlTransaction())
            {
                if (SessionHelper.IsAdmin())
                {
                    using (DataTable table = Accounts.GetAccounts())
                    {
                        return(GetValues(table));
                    }
                }

                using (DataTable table = Accounts.GetNonConfidentialAccounts())
                {
                    return(GetValues(table));
                }
            }

            if (SessionHelper.IsAdmin())
            {
                using (DataTable table = Accounts.GetChildAccounts())
                {
                    return(GetValues(table));
                }
            }

            using (DataTable table = Accounts.GetNonConfidentialChildAccounts())
            {
                return(GetValues(table));
            }
        }
Exemple #2
0
        public override void OnControlLoad(object sender, EventArgs e)
        {
            using (ScrudForm scrud = new ScrudForm())
            {
                scrud.DenyAdd    = !SessionHelper.IsAdmin();
                scrud.DenyEdit   = !SessionHelper.IsAdmin();
                scrud.DenyDelete = !SessionHelper.IsAdmin();

                scrud.KeyColumn = "user_id";

                scrud.TableSchema = "policy";
                scrud.Table       = "auto_verification_policy";
                scrud.ViewSchema  = "policy";
                scrud.View        = "auto_verification_policy_scrud_view";

                scrud.PageSize = 100;

                scrud.DisplayFields = GetDisplayFields();
                scrud.DisplayViews  = GetDisplayViews();

                scrud.Text             = Titles.AutoVerificationPolicy;
                scrud.ResourceAssembly = Assembly.GetAssembly(typeof(AutoVerification));

                this.ScrudPlaceholder.Controls.Add(scrud);
            }

            base.OnControlLoad(sender, e);
        }