public void DeleteBase_Button(Base_Button model) { model.DeleteMark = 1; model.unbl = 1; _dbSession.Base_ButtonDal.Update(model); _dbSession.UnitWork.Commit(); }
public void AddBase_Button(Base_Button model) { model.unbl = 0; model.DeleteMark = 0; _dbSession.Base_ButtonDal.Add(model); _dbSession.UnitWork.Commit(); }
public void Add() { try { if (this.tree_Module.FocusedNode != null) { Base_Module BM = this.tree_Module.FocusedNode.Tag as Base_Module; Base_Button BB = new Base_Button(); BB.ModuleId = BM.ModuleId; EditForm form = new EditForm(BB, modolueName, true); form.IsAdd = true; if (form.ShowDialog() == DialogResult.OK) { listEntity.Add(form.Entity); } } else { MsgShowInfor("请选择父系统模块"); } } catch (Exception ex) { MsgShowException(ex); } }
public void Delete() { try { if (this.main_View.FocusedRowHandle >= 0) { if (!MsgAskQuestion("是否删除一条数据?")) { return; } Base_Button BM = this.main_View.GetRow(this.main_View.FocusedRowHandle) as Base_Button; IDatabase database = new Database(); if (database.Delete <Base_Module>(BM) > 0) { listEntity.Remove(BM); } EditForm form = new EditForm(BM, modolueName, false); } else { MsgShowInfor("请选择数据"); } } catch (Exception ex) { MsgShowException(ex); } }
//Initialization method public Front_End_UI(Front_End curState, Engine_Core coreRef, IGame_State_Base stateInterface) { //Store references stateFunctions = stateInterface; engCoreRef = coreRef; state = curState; //---------------GENERATE BUTTONS--------------- //Create the Start Game Button Base_Button.ClickEvent clickEvent = GoToGame; startGameButton = new Base_Button( new Sprite() { Texture = engCoreRef.Content.Load <Texture2D>("UI/Front_End/Test_Button"), Color = Color.White, Size = new Rectangle(engCoreRef.GraphicsDevice.Viewport.Width / 2 - 128, (engCoreRef.GraphicsDevice.Viewport.Height / 2) - 32, 256, 64) }, new TextSprite() { Font = engCoreRef.Content.Load <SpriteFont>("UI/Fonts/Menu_Button_01"), Text = "Start Game", Color = Color.White }, clickEvent); //Create the Exit Game Button clickEvent = ExitGame; exitGameButton = new Base_Button( new Sprite() { Texture = engCoreRef.Content.Load <Texture2D>("UI/Front_End/Test_Button"), Color = Color.White, Size = new Rectangle(engCoreRef.GraphicsDevice.Viewport.Width / 2 - 128, (engCoreRef.GraphicsDevice.Viewport.Height / 2) + (engCoreRef.GraphicsDevice.Viewport.Height / 6) - 32, 256, 64) }, new TextSprite() { Font = engCoreRef.Content.Load <SpriteFont>("UI/Fonts/Menu_Button_01"), Text = "Exit Game", Color = Color.White }, clickEvent); //Add the buttons to the draw stack engCoreRef.drawStack.Add("Start_Game_Button", startGameButton.myArt); engCoreRef.textDrawStack.Add("Start_Game_Button_Text", startGameButton.myText); engCoreRef.drawStack.Add("Exit_Game_Button", exitGameButton.myArt); engCoreRef.textDrawStack.Add("Exit_Game_Button_Text", exitGameButton.myText); }
public EditForm(Base_Button BM, string parentFullName, bool isAdd) { InitializeComponent(); IsAdd = isAdd; Entity = BM; txtModuleName.Text = parentFullName; if (!IsAdd) { txtFullName.Text = Entity.FullName; txtIcon.Text = Entity.Icon; txtSortCode.Text = Entity.SortCode.ToString(); txtActionEvent.Text = Entity.ActionEvent; chkEnable.Checked = Entity.Enabled; } }
public void GetDataSource() { if (DataSource == null) { DataSource = new Base_Button(); } DataSource.ParentId = ParentID; DataSource.Split = ckSplit.Checked ? 1 : 0; DataSource.Code = txtCode.Text; DataSource.Category = txtCategory.Text == "工具栏" ? "1" : "2"; DataSource.Enabled = ckEnabled.Checked ? 1 : 0; DataSource.JsEvent = txtJsEvent.Text; DataSource.Icon = txtIcon.Text; DataSource.FullName = txtName.Text; DataSource.ActionEvent = txtActionEvent.Text; DataSource.SortCode = int.Parse(txtSortCode.Text); DataSource.Remark = txtRemark.Text; DataSource.ModuleId = ModuleID; }
private void button1_Click(object sender, EventArgs e) { if (gv_module.SelectedRows.Count > 0) { var list = (List <Base_Button>)gv_module.DataSource; Base_Button source = list[gv_module.SelectedRows[0].Index]; TreeSearch frm = new TreeSearch(); frm.AfterSelectNodeHandler += (x, y) => { source.ButtonId = 0; source.ParentId = 0; source.ModuleId = y; source.Category = source.Category == "工具栏" ? "1" : "2"; _bll.AddBase_Button(source); }; frm.ShowDialog(); } else { MessageBox.Show("请选择一条记录!"); } }
void menuOwner_ItemClick(object sender, ItemClickEventArgs e) { try { Base_Button base_button = e.Item.Tag as Base_Button; if (base_button == null) { return; } string action = base_button.ActionEvent; BaseFormEx form = (BaseFormEx)xtraTabbedMdiManager.SelectedPage.MdiChild; MethodInfo method = form.GetType().GetMethod(action, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); if (method != null) { method.Invoke(form, null); } } catch (Exception ex) { MsgShowException(ex); } }
public void Edit() { try { if (this.main_View.FocusedRowHandle >= 0) { Base_Button BM = this.main_View.GetRow(this.main_View.FocusedRowHandle) as Base_Button; EditForm form = new EditForm(BM, modolueName, false); if (form.ShowDialog() == DialogResult.OK) { listEntity[listEntity.IndexOf(BM)] = form.Entity; } } else { MsgShowInfor("请选择数据"); } } catch (Exception ex) { MsgShowException(ex); } }
public void UpdateBase_Button(Base_Button model) { _dbSession.Base_ButtonDal.Update(model); _dbSession.UnitWork.Commit(); }