Exemplo n.º 1
0
        /// <summary>
        /// 删除方法
        /// </summary>
        private void Delete()
        {
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction trans = new Neusoft.FrameWork.Management.Transaction(this.userMgr.Connection);
            // trans.BeginTransaction();
            userMgr.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            try
            {
                //删除此用户在此处拥有的权限
                int parm = userMgr.Delete(this.userPowerDetail.User.ID, this.userPowerDetail.Class1Code, this.userPowerDetail.Dept.ID);
                if (parm == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                    MessageBox.Show(userMgr.Err);
                    return;
                }
            }
            catch (Exception e)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                MessageBox.Show("删除人员数据失败!" + e.Message, "提示");
                return;
            }
            Neusoft.FrameWork.Management.PublicTrans.Commit();
            this.FindForm().DialogResult = DialogResult.OK;
            MessageBox.Show("删除人员成功!");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 设置Trans
        /// </summary>
        /// <param name="trans"></param>
        public override void SetTrans(System.Data.IDbTransaction trans)
        {
            this.trans = trans;

            powerManager.SetTrans(trans);
        }