private void FrmListDoreha_Load(object sender, EventArgs e) { Fillgridview1(); if (lblUserId.Text == "1") { chkIsActive.Visible = true; labelControl5.Visible = true; chkDoreIsClose.Visible = true; } HelpClass1.InActiveControls(xtraTabPage1); //using (var db = new MyContext()) //{ // try // { // int _UserId = Convert.ToInt32(lblUserId.Text); // var q1 = db.RmsUserBmsAccessLevelMenus.Where(s => s.MsUserId == _UserId).ToList(); // if (q1.Count() > 0) // { // //btnCreate.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 55010201) ? BarItemVisibility.Never : BarItemVisibility.Always; // //btnEdit.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 55010202) ? BarItemVisibility.Never : BarItemVisibility.Always; // //btnDelete.Visibility = q1.Any(s => s.MsAccessLevelMenuId == 55010203) ? BarItemVisibility.Never : BarItemVisibility.Always; // } // } // catch (Exception ex) // { // XtraMessageBox.Show("عملیات با خطا مواجه شد" + "\n" + ex.Message, // "پیغام", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} }
private void btnCancel_Click(object sender, EventArgs e) { gridControl1.Enabled = true; En = EnumCED.Cancel; HelpClass1.ActiveButtons(panelControl2); HelpClass1.ClearControls(panelControl1); HelpClass1.InActiveControls(panelControl1); btnDelete.Enabled = btnEdit.Enabled = btnLast.Enabled = btnNext.Enabled = btnPreview.Enabled = btnFirst.Enabled = false; btnCreate.Focus(); }
private void btnCancel_Click(object sender, EventArgs e) { if (btnCancel.Enabled) { gridControl1.Enabled = true; HelpClass1.ActiveButtons(panelControl2); HelpClass1.ClearControls(xtraTabPage1); HelpClass1.InActiveControls(xtraTabPage1); } }