Esempio n. 1
0
        public fGroups(Form f)
            : base(f)
        {
            InitializeComponent();

            mySecMan = AtMng.SecurityManager;
            mySecMan.GetsecGroup().Load();
            mySecMan.GetsecMembership().Load();
            mySecMan.GetsecUser().Load();

            secGroupBindingSource.DataSource = mySecMan.DB;

            secGroupGridEX.DropDowns["ddGroup"].SetDataBinding(mySecMan.DB.secGroup, "");
            secGroupGridEX.DropDowns["ddUser"].SetDataBinding(mySecMan.DB.secUser, "");
        }
Esempio n. 2
0
        public fRules(Form f) : base(f)
        {
            InitializeComponent();

            mySecMan = AtMng.SecurityManager;
            mySecMan.GetsecRule().Load();
            mySecMan.GetsecFeature().Load();
            mySecMan.GetsecPermission().Load();
            mySecMan.GetsecPermLevel().Load();

            secRuleBindingSource.DataSource = mySecMan.DB;

            secRuleGridEX.DropDowns["ddFeature"].SetDataBinding(mySecMan.DB.secFeature, "FeatureName");
            secRuleGridEX.DropDowns["ddPermLevel"].SetDataBinding(new DataView(mySecMan.DB.secPermLevel, "Permlevel>1 or Permlevel=0", "Permlevel", DataViewRowState.CurrentRows), "");
            secRuleGridEX.DropDowns["ddPermLevelAllow"].SetDataBinding(new DataView(mySecMan.DB.secPermLevel, "Permlevel<2", "Permlevel", DataViewRowState.CurrentRows), "");
            cmdFeatureCount.Text = mySecMan.DB.secFeature.Count.ToString();
        }
Esempio n. 3
0
        public override void Delete()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    atSecurity.SecurityManager mySM = FM.AtMng.SecurityManager;
                    SecurityDB.secUserRow      sur  = null;

                    if (!CurrentRow().IsUserNameNull())
                    {
                        sur = mySM.GetsecUser().Load(CurrentRow().UserName);
                    }

                    CurrentRow().Delete();
                    this.officerBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();

                    bp.AddForUpdate(FM.LeadOfficeMng.GetOfficer());
                    bp.AddForUpdate(FM.EFile);

                    if (sur != null)
                    {
                        sur.Delete();
                        //   bp.AddForUpdate(mySM.GetsecFileRule());
                        bp.AddForUpdate(mySM.GetsecMembership());
                        bp.AddForUpdate(mySM.GetsecUser());
                    }
                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
Esempio n. 4
0
        public fDataDictionnary(Form f)
            : base(f)
        {
            InitializeComponent();
            //App FMain Loads All data, don't need to load again,.
            //AtMng.GetddTable().Load();
            //AtMng.GetddField().Load();
            ddTableBindingSource.DataSource = AtMng.DB.ddTable;
            ddFieldBindingSource.DataSource = AtMng.DB.ddField;

            DataView dv1 = new DataView(AtMng.acMng.DB.ACDocumentation);

            aCDocumentationBindingSource.DataSource = dv1;
            aCDocumentationBindingSource.Filter     = "ACDocid=0";

            DataView dv2 = new DataView(AtMng.acMng.DB.ACDocumentation);

            ddFieldRuleMSg.DataSource = dv2;
            ddFieldRuleMSg.Filter     = "ACDocid=0";

            atriumBE.FileManager fm = AtMng.GetFile();

            DataTable dtDatasetName;

            dtDatasetName = new DataTable("DatasetList");
            dtDatasetName.Columns.Add("dsName", typeof(string));
            dtDatasetName.Columns.Add("dsFullName", typeof(string));
            dtDatasetName.Rows.Add("ActivityConfig", "ActivityConfig Dataset");
            dtDatasetName.Rows.Add("appDB", "AppDB Dataset");
            dtDatasetName.Rows.Add("CodesDB", "CodesDB Dataset");
            dtDatasetName.Rows.Add("atriumDB", "AtriumDB Dataset");
            dtDatasetName.Rows.Add("docDB", "DocDB Dataset");
            dtDatasetName.Rows.Add("officeDB", "OfficeDB Dataset");
            dtDatasetName.Rows.Add("SecurityDB", "SecurityDB Dataset");
            dtDatasetName.Rows.Add("HelpDB", "HelpDB Dataset");
            dtDatasetName.Rows.Add("SST", "SST Dataset");
            dtDatasetName.Rows.Add("CLAS", "CLAS Dataset");
            dtDatasetName.Rows.Add("Advisory", "Advisory Dataset");

            DataTable dtEvents = AtMng.GetddRule().dtEvents;

            DataTable dtRuleTypes = AtMng.GetddRule().dtRuleTypes;

            UIHelper.ComboBoxInit(new DataView(dtEvents, "Id not in (1,7,10)", "", DataViewRowState.CurrentRows), ucTableEvent, fm);
            UIHelper.ComboBoxInit(new DataView(dtEvents, "Id in (1,7,10)", "", DataViewRowState.CurrentRows), eventIducMultiDropDown, fm);
            //UIHelper.ComboBoxInit(dtEvents, ucTableEvent, fm);

            UIHelper.ComboBoxInit(new DataView(dtRuleTypes, "id in (0,2,99)", "", DataViewRowState.CurrentRows), ucTableRuleType, fm);
            UIHelper.ComboBoxInit(new DataView(dtRuleTypes), ruleTypeIducMultiDropDown, fm);
            //UIHelper.ComboBoxInit(dtRuleTypes, ucTableEvent, fm);

            UIHelper.ComboBoxInit(dtDatasetName, ddTableGridEX.DropDowns["ddDataset"], fm);
            UIHelper.ComboBoxInit("ACControlType", ddFieldGridEX.DropDowns["ddACControlType"], fm);
            UIHelper.ComboBoxInit(dtDatasetName, mccDataset, fm);
            UIHelper.ComboBoxInit("ACControlType", mccACControlType, fm);

            DataView dvACSeries = new DataView(AtMng.acMng.DB.ACSeries, "(steptype=11) and obsolete=0", "stepcode", DataViewRowState.CurrentRows);

            suffixComboBox.SetDataBinding(dvACSeries, "");

            DataView dvACSeriesRules = new DataView(AtMng.acMng.DB.ACSeries, "(steptype in(10,12)) and obsolete=0", "stepcode", DataViewRowState.CurrentRows);

            ucTableRuleACS.SetDataBinding(dvACSeriesRules, "");
            ucFieldRuleACS.SetDataBinding(dvACSeriesRules, "");

            atSecurity.SecurityManager mySecMan = AtMng.SecurityManager;
            mySecMan.GetsecFeature().Load();
            UIHelper.ComboBoxInit(new System.Data.DataView(mySecMan.DB.secFeature, "", "FeatureName", DataViewRowState.CurrentRows), mccFeature, fm);
            UIHelper.ComboBoxInit(new System.Data.DataView(mySecMan.DB.secFeature, "", "FeatureName", DataViewRowState.CurrentRows), ucFieldFeatureId, fm);

            UIHelper.ComboBoxInit(AtMng.DB.ddLookup, mccLookup, fm);

            dtReferencedInSteps = new DataTable("dtReferencedInSteps");
            dtReferencedInSteps.Columns.Add("FieldId", typeof(int));
            dtReferencedInSteps.Columns.Add("StepCode", typeof(string));
            dtReferencedInSteps.Columns.Add("TaskType", typeof(string));
            dtReferencedInSteps.Columns.Add("ObjectAlias", typeof(string));
            dtReferencedInSteps.Columns.Add("Block", typeof(string));
            dtReferencedInSteps.Columns.Add("ActivityFieldID", typeof(int));
            dtReferencedInSteps.Columns.Add("ActivityNameEng", typeof(string));
            dtReferencedInSteps.Columns.Add("SeriesCode", typeof(string));
            dtReferencedInSteps.Columns.Add("SeriesDescEng", typeof(string));
            dtReferencedInSteps.Columns.Add("ACSeriesId", typeof(int));
            dtReferencedInSteps.Columns.Add("SeriesId", typeof(int));
            dtReferencedInSteps.Columns.Add("DefaultValue", typeof(string));
            UIHelper.SetDataTableAsGridDataSource(gridEX1, dtReferencedInSteps);
            bindingSourceFieldReference.DataSource = dtReferencedInSteps;
            gridEX1.DataSource = bindingSourceFieldReference;
        }
Esempio n. 5
0
        public void Init(atSecurity.SecurityManager sm, lmDatasets.officeDB.OfficerRow or)
        {
            mySM = sm;
            myOr = or;

            secUserBindingSource.DataSource = mySM.DB;
            secUserBindingSource.DataMember = "secUser";;

            if (!or.IsUserNameNull())
            {
                sur = mySM.GetsecUser().Load(or.UserName);
            }
            else
            {
                sur = null;
            }

            if (sur == null)
            {
                isNew = true;
                sur   = mySM.DB.secUser.NewsecUserRow();
                if (!or.IsUserNameNull())
                {
                    sur.UserName = or.UserName;
                }

                mySM.DB.secUser.AddsecUserRow(sur);
                //mySM.GetsecMembership().Add(sur);
                btnDeleteOfficerAccount.Enabled = false;
            }
            else
            {
                bool NotEnabled = true;
                if (sur.AuthType == 0)
                {
                    bool SQLAccountExists = mySM.GetsecUser().DoesSQLUserExist(sur.UserName);
                    if (!SQLAccountExists)
                    {
                        secUserExistsWithoutSQLAccount = true;
                        NotEnabled = false;
                    }
                }

                if (NotEnabled)
                {
                    isNew = false;
                    userNameEditBox.Enabled = false;
                    uiRadioButton1.Enabled  = false;
                    uiRadioButton2.Enabled  = false;
                }
                else
                {
                    //handle out of sync issue with atrium and sql accounts
                    MessageBox.Show("We're sorry, but something's gone wrong. It seems this user has an Atrium security account, but does not have a SQL account. Please rectify this immediately.");
                }
            }


            mySM.GetsecGroup().Load();
            mySM.GetsecMembership().LoadByUserId(sur.UserId);

            secMembershipGridEX.DropDowns["ddGroup"].SetDataBinding(mySM.DB.secGroup, "");
            secUserBindingSource.Filter = "UserId=" + sur.UserId;
        }