示例#1
0
        /// <summary>
        /// 批准归档申请——赵英武
        /// </summary>
        /// <param name="apply"></param>
        /// <param name="archiveResource"></param>
        public void PermitApply(int apply, int archiveResource)
        {
            CACLEntity acl = new CACLEntity();

            acl.Acl_Operation = (int)ACLOPERATION.AUDITAPPLY;
            acl.Acl_Resource  = this.Usr_Organize;

            if (!CheckPrivilege(acl))
            {
                throw new Exception("没有管理归档申请的权限!");
            }

            CApplyEntity aRes = new CApplyEntity().Load(apply);

            if (aRes.App_Audited == (int)AUDITE.AUDITED || aRes.App_Audited == (int)AUDITE.UNAUDITED)
            {
                throw new Exception("该资源已审核!");
            }

            try
            {
                this.CopyResource(aRes.App_ResId, archiveResource);
                aRes.Permit();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#2
0
        /// <summary>
        /// 删除归档申请,删除成功return true,否则return false——赵英武
        /// </summary>
        /// <param name="apply"></param>
        public bool DeleteApply(int apply)
        {
            CApplyEntity aRes = new CApplyEntity().Load(apply);

            if (aRes.App_Applyer == this.Usr_Id && aRes.App_Audited == (int)AUDITE.UNAUDITING)
            {
                aRes.Delete();
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        /// <summary>
        /// 创建新的归档申请,resource代表申请归档的资源id,comment是用户填写的申请说明。——赵英武
        /// </summary>
        /// <param name="resource"></param>
        /// <param name="comment"></param>
        public bool CreateApply(int resource, String comment)
        {
            CApplyEntity aRes = new CApplyEntity();

            if (aRes.GetObjectList("this.App_ResId='" + resource + "'").Count > 0)
            {
                return(false);
            }

            aRes.App_ResId      = resource;
            aRes.App_Applyer    = this.Usr_Id;
            aRes.App_Comment    = comment;
            aRes.App_Audited    = (int)AUDITE.UNAUDITING;
            aRes.App_CreateTime = DateTime.Now;
            aRes.Insert();
            return(true);
        }
示例#4
0
        /// <summary>
        /// 不批准归档申请——赵英武
        /// </summary>
        /// <param name="apply"></param>
        public void CancelApply(int apply)
        {
            CACLEntity acl = new CACLEntity();

            acl.Acl_Operation = (int)ACLOPERATION.AUDITAPPLY;
            acl.Acl_Resource  = this.Usr_Organize;

            if (!CheckPrivilege(acl))
            {
                throw new Exception("没有管理归档申请的权限!");
            }

            CApplyEntity aRes = new CApplyEntity().Load(apply);

            if (aRes.App_Audited == (int)AUDITE.UNAUDITED || aRes.App_Audited == (int)AUDITE.AUDITED)
            {
                throw new Exception("该资源已审核!");
            }

            aRes.Cancel();
        }