/// <summary>
        /// 为指定部门申请指定的资产
        /// </summary>
        /// <param name="deptId">部门ID</param>
        /// <param name="astIds">申请的资产ID</param>
        /// <param name="reason">申请原因</param>
        /// <returns></returns>
        public int DoApplyAddInBatch(string deptId, string[] astIds, string reason)
        {
            IList list = AssetApplyDao.FindAssetsByIds(astIds);
            IList listForSave = new ArrayList();

            foreach (AssetApply_Asset o in list)
            {
                AssetApply asset = new AssetApply();

                asset.AplDeptID = deptId;
                asset.AplType = "0001"; //申请类型置为新增
                asset.AssetID = o.AssetID;
                asset.AssetName = o.AssetName;
                asset.AssetModel = o.AssetModel;
                asset.AssetSpec = o.AssetSpec;
                asset.AssetType = o.AssetType;
                asset.AssetSubType = o.AssetSubtype;
                asset.AplAmount = 1;
                asset.AplReason = reason;
                asset.AplStatus = "0001";//申请状态置为已申请

                listForSave.Add(asset);
            }

            return AssetApplyDao.SaveSome(listForSave);
        }
        /// <summary>
        /// 资产新增申请处理
        /// </summary>
        /// <param name="ast">要进行申请的资产对象</param>
        /// <returns></returns>
        public int DoApplyAdd(AssetApply ast)
        {
            ast.AplType = "0001";//申请类型=新增
            ast.AplStatus = "0001";//申请状态=已申请

            return AssetApplyDao.SaveOne(ast);
        }
Example #3
0
 public int Update(AssetApply o)
 {
     try
     {
         HibernateTemplate.SaveOrUpdate(o);
         return 1;
     }
     catch
     {
         return 0;
     }
 }
Example #4
0
 public int SaveOne(AssetApply asset)
 {
     try
     {
         HibernateTemplate.Save(asset);
         return 1;
     }
     catch
     {
         return 0;
     }
 }
        public int DoApplyDestroy(string id, string reason)
        {
            AssetApply_Asset ast = AssetApplyDao.FindAssetById(id);

            AssetApply target = new AssetApply();
            target.AssetID = ast.AssetID;
            target.AssetName = ast.AssetName;
            target.AssetModel = ast.AssetModel;
            target.AssetSpec = ast.AssetSpec;
            target.AssetType = ast.AssetType;
            target.AssetSubType = ast.AssetSubtype;
            target.AplDeptID = ast.BelongingDept;
            target.AplAmount = 1;
            target.AplType = "0004"; //申请报废
            target.AplStatus = "0001"; //已申请
            target.AplReason = reason;

            return AssetApplyDao.SaveOne(target);
        }