コード例 #1
0
ファイル: tb_Sys_Controls.cs プロジェクト: windygu/KQERP
        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();
        }
コード例 #2
0
ファイル: tb_Sys_Controls.cs プロジェクト: windygu/KQERP
        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();
        }
コード例 #3
0
ファイル: SysControlForm.cs プロジェクト: windygu/KQERP
        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();
            }
        }
コード例 #4
0
ファイル: A004_RoleControl.cs プロジェクト: windygu/KQERP
        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("删除成功");
                    }
                }
            }
        }
コード例 #5
0
ファイル: SysControlForm.cs プロジェクト: windygu/KQERP
 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();
         }
     }
 }
コード例 #6
0
 public SysControlEditForm(tb_Sys_Controls tempData)
 {
     InitializeComponent();
     this.tbSysControlsBindingSource.DataSource = tempData;
 }