Esempio n. 1
0
        /// <summary>
        /// 用唯一值实现Equals
        /// </summary>
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if ((obj == null) || (obj.GetType() != GetType()))
            {
                return(false);
            }
            Item_File castObj = (Item_File)obj;

            return((castObj != null) &&
                   (this.FileName == castObj.FileName));
        }
Esempio n. 2
0
        /// <summary>
        /// 获取项目文件(按多个环节)
        /// </summary>
        /// <param name="itemCode"></param>
        /// <param name="node"></param>
        /// <returns></returns>
        public List<Item_File> GetItemFileByNode(string itemCode, string node)
        {
            string strSql = " select a.*, decode(a.filecode, 0, '其它文件', b.filename) FileType"
                        + " from item_file a  left join wf_file b on a.filecode = b.filecode"
                        + " Where a.ItemCode = '{0}' and a.NodeId in ({1}) order by a.nodeid,a.filecode";
            strSql = string.Format(strSql, itemCode, node);
            IDataReader dr = OracleHelper.ExecuteReader(strSql);
            List<Item_File> fileList = new List<Item_File>();
            while (dr.Read())
            {
                Item_File file = new Item_File();
                file.ItemCode = dr["ItemCode"].ToString();
                file.FileCode = dr["FileCode"].ToString();
                file.FileCodeName = dr["FileType"].ToString();
                file.FileName = dr["FileName"].ToString();
                file.Stage = (ItemStage)EnumHelper.StringValueToEnum(typeof(ItemStage), dr["Stage"].ToString());
                file.NodeId = (WorkFlowNode)EnumHelper.StringValueToEnum(typeof(WorkFlowNode), dr["NodeId"].ToString());
                file.UserId = dr["UserId"].ToString();
                file.UserName = dr["UserName"].ToString();
                file.CreateDate = TypeConvert.Convert<DateTime?>(dr["CreateDate"]);

                fileList.Add(file);
            }
            dr.Close();
            return fileList;
        }
Esempio n. 3
0
        public List<Item_File> GetItemFileAfterExclude(string itemCode, WorkFlowNode wfNode, List<FileCode> excludeFileCodes)
        {
            string strSql = " select a.*, decode(a.filecode, 0, '其它文件', b.filename) FileType"
                        + " from item_file a  left join wf_file b on a.filecode = b.filecode"
                        + " Where a.ItemCode = '{0}' and a.NodeId = '{1}' and a.filecode not in ({2})";
            string[] fileCodes = (from record in excludeFileCodes select "'" + ((int)record).ToString() + "'").Distinct().ToArray();
            strSql = string.Format(strSql, itemCode, (int)wfNode, string.Join(",", fileCodes));
            IDataReader dr = OracleHelper.ExecuteReader(strSql);
            List<Item_File> fileList = new List<Item_File>();
            while (dr.Read())
            {
                Item_File file = new Item_File();
                file.ItemCode = dr["ItemCode"].ToString();
                file.FileCode = dr["FileCode"].ToString();
                file.FileCodeName = dr["FileType"].ToString();
                file.FileName = dr["FileName"].ToString();
                file.Stage = (ItemStage)EnumHelper.StringValueToEnum(typeof(ItemStage), dr["Stage"].ToString());
                file.NodeId = (WorkFlowNode)EnumHelper.StringValueToEnum(typeof(WorkFlowNode), dr["NodeId"].ToString());
                file.UserId = dr["UserId"].ToString();
                file.UserName = dr["UserName"].ToString();
                file.CreateDate = TypeConvert.Convert<DateTime?>(dr["CreateDate"]);

                fileList.Add(file);
            }
            dr.Close();
            return fileList;
        }
Esempio n. 4
0
        /// <summary>
        /// 获取项目文件
        /// </summary>
        /// <param name="itemCode"></param>
        /// <returns></returns>
        public List<Item_File> GetItemFile(string itemCode, WorkFlowNode wfNode, string fileCode, string xh)
        {
            List<object> parameters = new List<object>();
            string strSql = " select a.*, decode(a.filecode, 0, '其它文件', b.filename) FileType"
                        + " from item_file a  left join wf_file b on a.filecode = b.filecode"
                        + " Where a.ItemCode = '{0}' and a.NodeId = '{1}' and a.filecode = '{2}'";
            parameters.Add(itemCode);
            parameters.Add((int)wfNode);
            parameters.Add(fileCode);
            if (!string.IsNullOrEmpty(xh))
            {
                strSql += " and a.xh='{3}'";
                parameters.Add(xh);
            }
            strSql = string.Format(strSql, parameters.ToArray());
            IDataReader dr = OracleHelper.ExecuteReader(strSql);
            List<Item_File> fileList = new List<Item_File>();
            while (dr.Read())
            {
                Item_File file = new Item_File();
                file.ItemCode = dr["ItemCode"].ToString();
                file.FileCode = dr["FileCode"].ToString();
                file.FileCodeName = dr["FileType"].ToString();
                file.FileName = dr["FileName"].ToString();
                file.Stage = (ItemStage)EnumHelper.StringValueToEnum(typeof(ItemStage), dr["Stage"].ToString());
                file.NodeId = (WorkFlowNode)EnumHelper.StringValueToEnum(typeof(WorkFlowNode), dr["NodeId"].ToString());
                file.UserId = dr["UserId"].ToString();
                file.UserName = dr["UserName"].ToString();
                file.CreateDate = TypeConvert.Convert<DateTime?>(dr["CreateDate"]);

                fileList.Add(file);
            }
            dr.Close();
            return fileList;
        }