Beispiel #1
0
        /// <summary>
        /// ɾ����ɫ
        /// </summary>
        /// <param name="oParam"></param>
        /// <returns></returns>
        public int DeleteDept(int SysNo)
        {
            int _return = 0;

            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;
            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                _return = new DepartMentDC().DelDept(SysNo);
                scope.Complete();
            }
            return _return;
        }
Beispiel #2
0
        /// <summary>
        /// ��Ӳ��š�
        /// </summary>
        /// <param name="paramRolePrivilegeSysNo"></param>
        /// <returns></returns>
        public int InsertDeptInfo(OperationTypeInfo oParam,string paramDelSql)
        {
            bool isAdd = false;
            int _return = 0;

            if (oParam.SysNo == -1) isAdd = true;

            string[] strPrivilege = paramDelSql.Split(',');
            if(isAdd) oParam.SysNo = SequenceDac.GetInstance().Create("Sys_Sequence");
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;
            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                _return = new DepartMentDC().InsertOrUpdateDepart(oParam,isAdd);
                _return = new DepartMentDC().DelPrivilegeDept(paramDelSql,oParam.SysNo);
                for (int i = 0; i < strPrivilege.Length; i++)
                {
                    if (Util.IsNumber(strPrivilege[i]))
                        _return = new DepartMentDC().InsertPrivilegeDept(oParam.SysNo, Int16.Parse(strPrivilege[i]));
                }
                scope.Complete();
            }
            return _return;
        }