private void btn_RefreshUsers_Click(object sender, EventArgs e) { olv_PRDUSERS.ClearObjects(); olv_ACCUSERS.ClearObjects(); Prd_Users = SynapseUser.Load(); Acc_Users = ACCSynapseUser.Load(); Prd_UserProfiles = SynapseUser_Profile.Load(); Acc_UserProfiles = ACCSynapseUser_Profile.Load(); olv_ACCUSERS.SetObjects(Acc_Users.OrderBy(au => au.UserID)); olv_PRDUSERS.SetObjects(Prd_Users.OrderBy(pu => pu.UserID)); }
private void btn_analyse_Click(object sender, EventArgs e) { Presentation.Clear(); string[] ids = (from id in olv_Modules.CheckedObjects.Cast <SynapseModule>() select id.ID.ToString()).ToArray(); string str_id = string.Join(",", ids); Prd_Users = SynapseUser.Load(); Acc_Users = ACCSynapseUser.Load(); obj_sync pr = new obj_sync(); pr.Name = typeof(SynapseUser).FullName; pr.PrdCnt = Prd_Users.Count; pr.AccCnt = Acc_Users.Count; pr.Link = (from l in AccToPrdID where l.OBJECTTYPE == typeof(ACCSynapseUser).Name select l).Count(); Presentation.Add(pr); Prd_Profiles = SynapseProfile.Load("WHERE FK_MODULEID in (" + str_id + ")"); Acc_Profiles = ACCSynapseProfile.Load("WHERE FK_MODULEID in (" + str_id + ")"); pr = new obj_sync(); pr.Name = typeof(SynapseProfile).FullName; pr.PrdCnt = Prd_Profiles.Count; pr.AccCnt = Acc_Profiles.Count; IList <Int64> Acc_Profiles_IDs = (from i in Acc_Profiles select i.ID).ToList(); pr.Link = (from l in AccToPrdID where l.OBJECTTYPE == typeof(ACCSynapseProfile).Name && Acc_Profiles_IDs.Contains(l.ACCID) select l).Count(); Presentation.Add(pr); string Prd_ProfilesID = string.Join(",", (from p in Prd_Profiles select p.ID.ToString()).ToArray()); string Acc_ProfilesID = string.Join(",", (from p in Acc_Profiles select p.ID.ToString()).ToArray()); Prd_Controls = SynapseControl.Load("WHERE FK_MODULE_ID in (" + str_id + ")"); Acc_Controls = ACCSynapseControl.Load("WHERE FK_MODULE_ID in (" + str_id + ")"); pr = new obj_sync(); pr.Name = typeof(SynapseControl).FullName; pr.PrdCnt = Prd_Controls.Count; pr.AccCnt = Acc_Controls.Count; IList <Int64> Acc_Controls_IDs = (from i in Acc_Controls select i.ID).ToList(); pr.Link = (from l in AccToPrdID where l.OBJECTTYPE == typeof(ACCSynapseControl).Name && Acc_Controls_IDs.Contains(l.ACCID) select l).Count(); Presentation.Add(pr); string Prd_ControlsID = string.Join(",", (from c in Prd_Controls select c.ID.ToString()).ToArray()); string Acc_ControlsID = string.Join(",", (from c in Acc_Controls select c.ID.ToString()).ToArray()); if (Prd_ControlsID.Length <= 0) { Prd_ProfileControls = new List <SynapseProfile_Control>(); } else { Prd_ProfileControls = SynapseProfile_Control.Load("WHERE FK_CONTROLID in (" + Prd_ControlsID + ")"); } try { Acc_ProfileControls = ACCSynapseProfile_Control.Load("WHERE FK_CONTROLID in (" + Acc_ControlsID + ")"); } catch { Acc_ProfileControls = new List <ACCSynapseProfile_Control>(); } pr = new obj_sync(); pr.Name = typeof(SynapseProfile_Control).FullName; pr.PrdCnt = Prd_ProfileControls.Count; pr.AccCnt = Acc_ProfileControls.Count; IList <Int64> Acc_ProfileControls_IDs = (from i in Acc_ProfileControls select i.ID).ToList(); pr.Link = (from l in AccToPrdID where l.OBJECTTYPE == typeof(ACCSynapseProfile_Control).Name && Acc_ProfileControls_IDs.Contains(l.ACCID) select l).Count(); Presentation.Add(pr); if (Prd_ProfilesID.Length <= 0) { Prd_UserProfiles = new List <SynapseUser_Profile>(); } else { Prd_UserProfiles = SynapseUser_Profile.Load("WHERE FK_SECURITY_PROFILE in (" + Prd_ProfilesID + ")"); } Acc_UserProfiles = ACCSynapseUser_Profile.Load("WHERE FK_SECURITY_PROFILE in (" + Acc_ProfilesID + ")"); pr = new obj_sync(); pr.Name = typeof(SynapseUser_Profile).FullName; pr.PrdCnt = Prd_UserProfiles.Count; pr.AccCnt = Acc_UserProfiles.Count; IList <Int64> Acc_UserProfiles_IDs = (from i in Acc_UserProfiles select i.ID).ToList(); pr.Link = (from l in AccToPrdID where l.OBJECTTYPE == typeof(ACCSynapseUser_Profile).Name && Acc_UserProfiles_IDs.Contains(l.ACCID) select l).Count(); Presentation.Add(pr); olv_analyse.SetObjects(Presentation); }