private void CurrentResButtonAction(Action <Resbutton> action) { Resbutton resbutton = gridViewResButton.GetFocusedRow() as Resbutton; if (resbutton == null) { return; } action(resbutton); }
/// <summary> /// 保存数据 /// </summary> /// <param name="resbutton"></param> /// <returns></returns> private void Save(Resbutton resbutton) { try { //resbutton.Sysid = rightManager.CreateResButton(resbutton.Formname, resbutton.Buttonname); bindingListResButton.Add(resbutton); } catch (Exception ex) { ExceptionAction(ex); } }
private void simpleButtonResButtonSave_Click(object sender, EventArgs e) { if (this.ValidateChildren() == false) { return; } Resbutton resbutton = new Resbutton(); resbutton.Buttonname = textEditButtonname.Text.Trim(); resbutton.Formname = textEditFormname.Text.Trim(); Save(resbutton); ValidateChildren(); }
/// <summary> /// 删除 /// </summary> /// <param name="resbuttonCurrent"></param> private void Delete(Resbutton resbuttonCurrent) { if (resbuttonCurrent.Sysid != null) { if (XtraMessageBox.Show("是否删除当前选中数据?", "提醒", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { //rightManager.DeleteResButtonById(resbuttonCurrent.Sysid); bindingListResButton.Remove(resbuttonCurrent); } catch (Exception ex) { ExceptionAction(ex); } } } }
private void gridViewResButton_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Resbutton resbutton = gridViewResButton.GetFocusedRow() as Resbutton; this.resbuttonClient.PropertyValueChanged(resbutton, e.Column.FieldName); }