private void FrmMain_Load(object sender, EventArgs e) { HelpClass1.SwitchToPersianLanguage(); HelpClass1.SetRegionAndLanguage(); //_UserId = Convert.ToInt32(txtUserId.Caption.ToString()); _UserId = 1; txtUserId.Caption = _UserId.ToString(); // that will manage MDI child windows. //documentManager1.View = new NativeMdiView(); ribbon.Minimized = true; //xtraTabbedMdiManager1 = new XtraTabbedMdiManager(); //xtraTabbedMdiManager1.MdiParent = this; documentManager1 = new DocumentManager { MdiParent = this, View = new TabbedView() }; FillcmbMajmoehaList(); using (var db = new MyContext()) { try { var q = db.MsDefaults.FirstOrDefault(s => s.MsUserId == _UserId); if (q != null) { cmbMajmoehaList.EditValue = q.MajmoeId; //chkDefault.Checked = true; } ////////////////////////////////////////////////////////////////////// var q1 = db.RmsUserBmsAccessLevelMenus.Where(s => s.MsUserId == _UserId).ToList(); if (q1.Count() > 0) { Ms.Visible = q1.Any(s => s.MsAccessLevelMenuId == 55) ? false : true; rpgOperationDafaterVaDoreMali.Visible = q1.Any(s => s.MsAccessLevelMenuId == 5501 || s.MsAccessLevelMenuId == 5502) ? false : true; mbsListDafaterMali.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 5501) ? BarItemVisibility.Never : BarItemVisibility.Always; btnListMojmoeha.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550101) ? BarItemVisibility.Never : BarItemVisibility.Always; btnListVahedha.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550102) ? BarItemVisibility.Never : BarItemVisibility.Always; btnListShobeha.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550103) ? BarItemVisibility.Never : BarItemVisibility.Always; btnListDorehaiMali.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550104) ? BarItemVisibility.Never : BarItemVisibility.Always; /////////////////////////// mbsOperationDoreMali.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 5502) ? BarItemVisibility.Never : BarItemVisibility.Always; /////////////////////////// rpgUsers.Visible = q1.Any(s => s.MsAccessLevelMenuId == 5503) ? false : true; mbsSystemUsers.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 5503) ? BarItemVisibility.Never : BarItemVisibility.Always; btnUsersList.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550301) ? BarItemVisibility.Never : BarItemVisibility.Always; btnDetermineAccessLevel.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550302) ? BarItemVisibility.Never : BarItemVisibility.Always; btnTaeenAccessLevelSystemVMenu.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 55030201) ? BarItemVisibility.Never : BarItemVisibility.Always; btnTaeenAcecessLevelDafaterMali.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 55030201) ? BarItemVisibility.Never : BarItemVisibility.Always; btnChangePassword.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 550303) ? BarItemVisibility.Never : BarItemVisibility.Always; ////////////////////////// } } catch (Exception ex) { XtraMessageBox.Show("عملیات با خطا مواجه شد" + "\n" + ex.Message, "پیغام", MessageBoxButtons.OK, MessageBoxIcon.Error); } } ////////////////////////////////////////////////////////////////////////////////// }