public void Create(tb_Sys_Controls tb_Sys_Controls) { tb_Sys_Controls.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; tb_Sys_Controls.CreateUser = tempUser.UserName; tb_Sys_Controls.CompCode = tempUser.CompCode; tb_Sys_Controls.Validate(); this.tb_Sys_ControlsRepository.Add(tb_Sys_Controls); this.runtimeService.Commit(); }
public void Update(tb_Sys_Controls tb_Sys_Controls) { tb_Sys_Controls.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; tb_Sys_Controls.ModifyUser = tempUser.UserName; tb_Sys_Controls.Validate(); var existstb_Sys_Menu = this.GetById(tb_Sys_Controls.Id); this.tb_Sys_ControlsRepository.SetValues(tb_Sys_Controls, existstb_Sys_Menu); this.runtimeService.Commit(); }
private void OpenForm(string formText, string btnCommand) { tb_Sys_Controls temp = this.tbSysControlsBindingSource.Current as tb_Sys_Controls; SysControlEditForm edit = new SysControlEditForm(temp); edit.Text = formText; edit.Tag = btnCommand; if (edit.ShowDialog() != DialogResult.OK) { this.tbSysControlsBindingSource.CancelEdit(); } }
private void btnDelControl_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { tb_Sys_Roles role = GvRoles.GetFocusedRow() as tb_Sys_Roles; if (gridViewControl.SelectedRowsCount >= 0) { tb_Sys_Controls control = gridViewControl.GetFocusedRow() as tb_Sys_Controls; if (control != null) { tb_Sys_RolesControl roleControl = roleControlService.GetByRolesIdAndControlId(role.Id, control.Id);//ServiceHelper.Current.DbSession.Itb_Sys_RoleActionDAL.GetListBy(m => m.RoleID == role.RoleID && m.Mo if (roleControl != null) { roleControlService.Delete(roleControl.Id); this.gridviewAction.DeleteSelectedRows(); XtraMessageBox.Show("删除成功"); } } } }
public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { // MessageBox.Show(e.Item.Caption); //新增 if (e.Item.Caption == BtnCommandEnum.Add) { this.tbSysControlsBindingSource.AddNew(); OpenForm("公司资料新增", BtnCommandEnum.Add); } else if (e.Item.Caption == BtnCommandEnum.Edit) { OpenForm("公司资料修改", BtnCommandEnum.Edit); } else if (e.Item.Caption == BtnCommandEnum.Delete) { if (ERPHelper.Instance.MessageDel()) { tb_Sys_Controls user = this.tbSysControlsBindingSource.Current as tb_Sys_Controls; controlService.Delete(user.Id); this.tbSysControlsBindingSource.RemoveCurrent(); } } }
public SysControlEditForm(tb_Sys_Controls tempData) { InitializeComponent(); this.tbSysControlsBindingSource.DataSource = tempData; }