Esempio n. 1
0
 /// <summary>
 /// 修改文件信息
 /// </summary>
 /// <param name="model"></param>
 /// <param name="ItemType">附件类型</param>
 /// <returns></returns>
 public bool UpdateGovDocuments(EyouSoft.Model.GovStructure.MGovDocuments model, EyouSoft.Model.EnumType.ComStructure.AttachItemType ItemType)
 {
     if (model != null && !string.IsNullOrEmpty(model.DocumentsId) && !string.IsNullOrEmpty(model.CompanyId) && !string.IsNullOrEmpty(model.FontSize) && !string.IsNullOrEmpty(model.Company) &&
         !string.IsNullOrEmpty(model.Title) && !string.IsNullOrEmpty(model.AttnId) && !string.IsNullOrEmpty(model.OperatorID))
     {
         if (model.ComAttachList != null && model.ComAttachList.Count > 0)
         {
             for (int i = 0; i < model.ComAttachList.Count; i++)
             {
                 model.ComAttachList[i].ItemId   = model.DocumentsId;
                 model.ComAttachList[i].ItemType = ItemType;
             }
         }
         else
         {
             model.ComAttachList = null;
         }
         if (model.GovDocumentsApproveList != null && model.GovDocumentsApproveList.Count > 0)
         {
             for (int i = 0; i < model.GovDocumentsApproveList.Count; i++)
             {
                 model.GovDocumentsApproveList[i].DocumentsId = model.DocumentsId;
             }
         }
         bool result = dal.UpdateGovDocuments(model, ItemType);
         if (result)
         {
             SysStructure.BSysLogHandle.Insert("修改一条文件管理:编号为:" + model.DocumentsId);
         }
         return(result);
     }
     return(false);
 }
Esempio n. 2
0
 protected void PageInit(string id)
 {
     EyouSoft.BLL.GovStructure.BDocuments      BLL   = new EyouSoft.BLL.GovStructure.BDocuments();
     EyouSoft.Model.GovStructure.MGovDocuments model = BLL.GetGovFilePersonnelModel(id);
     if (model != null)
     {
         this.lbTitle.Text    = model.Title;
         this.lbCompany.Text  = model.Company;
         this.lbFontSize.Text = model.FontSize;
         IList <EyouSoft.Model.ComStructure.MComAttach> lstFile = model.ComAttachList;
         StringBuilder strFile = new StringBuilder();
         if (null != lstFile && lstFile.Count > 0)
         {
             for (int i = 0; i < lstFile.Count; i++)
             {
                 strFile.AppendFormat("<span  class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a></span>", lstFile[i].FilePath, lstFile[i].Name);
             }
         }
         this.lbFiles.Text = strFile.ToString();
         if (model.GovDocumentsApproveList != null && model.GovDocumentsApproveList.Count > 0)
         {
             this.rpt_approve.DataSource = model.GovDocumentsApproveList;
             this.rpt_approve.DataBind();
             if (model.GovDocumentsApproveList.Where(item => (item.ApproveID) == this.SiteUserInfo.UserId).ToList().Count > 0)
             {
                 this.ph_Flies.Visible = true;
             }
             else
             {
                 this.ph_Flies.Visible = false;
             }
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 添加文件信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool AddGovDocuments(EyouSoft.Model.GovStructure.MGovDocuments model)
 {
     if (model != null && !string.IsNullOrEmpty(model.CompanyId) && !string.IsNullOrEmpty(model.FontSize) && !string.IsNullOrEmpty(model.Company) &&
         !string.IsNullOrEmpty(model.Title) && !string.IsNullOrEmpty(model.AttnId) && !string.IsNullOrEmpty(model.OperatorID))
     {
         model.DocumentsId = Guid.NewGuid().ToString();
         if (model.ComAttachList != null && model.ComAttachList.Count > 0)
         {
             for (int i = 0; i < model.ComAttachList.Count; i++)
             {
                 model.ComAttachList[i].ItemId   = model.DocumentsId;
                 model.ComAttachList[i].ItemType = ItemType;
             }
         }
         if (model.GovDocumentsApproveList != null && model.GovDocumentsApproveList.Count > 0)
         {
             for (int i = 0; i < model.GovDocumentsApproveList.Count; i++)
             {
                 model.GovDocumentsApproveList[i].DocumentsId = model.DocumentsId;
             }
         }
         bool result = dal.AddGovDocuments(model);
         if (result)
         {
             SysStructure.BSysLogHandle.Insert("增加一条文件管理:编号为:" + model.DocumentsId);
         }
         return(result);
     }
     return(false);
 }
Esempio n. 4
0
        /// <summary>
        /// 修改文件信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="ItemType">附件类型</param>
        /// <returns></returns>
        public bool UpdateGovDocuments(EyouSoft.Model.GovStructure.MGovDocuments model, EyouSoft.Model.EnumType.ComStructure.AttachItemType ItemType)
        {
            bool      IsTrue = false;
            DbCommand dc     = this._db.GetStoredProcCommand("proc_GovDocuments_Update");

            this._db.AddInParameter(dc, "DocumentsId", DbType.AnsiStringFixedLength, model.DocumentsId);
            this._db.AddInParameter(dc, "CompanyId", DbType.AnsiStringFixedLength, model.CompanyId);
            this._db.AddInParameter(dc, "FontSize", DbType.String, model.FontSize);
            this._db.AddInParameter(dc, "Company", DbType.String, model.Company);
            this._db.AddInParameter(dc, "Title", DbType.String, model.Title);
            this._db.AddInParameter(dc, "FileType", DbType.Byte, (int)model.FileType);
            this._db.AddInParameter(dc, "AttnId", DbType.AnsiStringFixedLength, model.AttnId);
            this._db.AddInParameter(dc, "OperatorId", DbType.AnsiStringFixedLength, model.OperatorID);
            this._db.AddInParameter(dc, "IssueTime", DbType.DateTime, model.IssueTime);
            this._db.AddInParameter(dc, "ApproveState", DbType.Byte, (int)model.ApproveState);
            this._db.AddInParameter(dc, "GovDocumentsApproveXML", DbType.Xml, CreateGovDocumentsApproveListXML(model.GovDocumentsApproveList));//审批人业务实体集合
            this._db.AddInParameter(dc, "ComAttachXML", DbType.Xml, CreateComAttachListXML(model.ComAttachList));
            this._db.AddInParameter(dc, "ItemType", DbType.Byte, (int)ItemType);
            this._db.AddOutParameter(dc, "Result", DbType.Int32, 4);
            EyouSoft.Toolkit.DAL.DbHelper.RunProcedure(dc, this._db);
            object Result = this._db.GetParameterValue(dc, "Result");

            if (!Result.Equals(null))
            {
                IsTrue = int.Parse(Result.ToString()) > 0 ? true : false;
            }
            return(IsTrue);
        }
Esempio n. 5
0
 /// <summary>
 /// 根据 文件ID 获取文件实体信息
 /// </summary>
 /// <param name="DocumentsId">文件ID</param>
 /// <returns></returns>
 public EyouSoft.Model.GovStructure.MGovDocuments GetGovFilePersonnelModel(string DocumentsId)
 {
     EyouSoft.Model.GovStructure.MGovDocuments model = null;
     if (!string.IsNullOrEmpty(DocumentsId))
     {
         model = new EyouSoft.Model.GovStructure.MGovDocuments();
         model = dal.GetGovDocumentsModel(DocumentsId, ItemType);
     }
     return(model);
 }
Esempio n. 6
0
        /// <summary>
        /// 获取文件信息列表
        /// </summary>
        /// <param name="CompanyId">公司编号</param>
        /// <param name="FontSize">文件字号</param>
        /// <param name="Company">发布单位</param>
        /// <param name="Title">标题</param>
        /// <param name="ItemType">附件类型</param>
        /// <param name="PageSize">页面数据总记录数</param>
        /// <param name="PageIndex">当前页数</param>
        /// <param name="RecordCount">每页显示的记录数</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.GovStructure.MGovDocuments> GetGovDocumentsList(string CompanyId, string FontSize, string Company, string Title, EyouSoft.Model.EnumType.ComStructure.AttachItemType ItemType, int PageSize, int PageIndex, ref int RecordCount)
        {
            IList <EyouSoft.Model.GovStructure.MGovDocuments> ResultList = null;
            string tableName          = "view_GovDocuments";
            string identityColumnName = "Id";
            string fields             = "DocumentsId,CompanyId,FontSize,Company,Title,FileType,AttnId,OperatorID,IssueTime,ApproveState,AttnName,ComAttachXML,GovDocumentsApproveXML  ";
            string query = string.Format(" CompanyId='{0}' ", CompanyId);

            if (!string.IsNullOrEmpty(FontSize))
            {
                query = query + string.Format(" AND FontSize LIKE '%{0}%'", FontSize);
            }
            if (!string.IsNullOrEmpty(Company))
            {
                query = query + string.Format(" AND Company LIKE '%{0}%'", Company);
            }
            if (!string.IsNullOrEmpty(Title))
            {
                query = query + string.Format(" AND Title LIKE '%{0}%'", Title);
            }
            string orderByString = " IssueTime DESC";

            using (IDataReader dr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(_db, PageSize, PageIndex, ref RecordCount, tableName, identityColumnName, fields, query, orderByString))
            {
                ResultList = new List <EyouSoft.Model.GovStructure.MGovDocuments>();
                EyouSoft.Model.GovStructure.MGovDocuments model = null;
                while (dr.Read())
                {
                    model             = new EyouSoft.Model.GovStructure.MGovDocuments();
                    model.DocumentsId = dr.GetString(dr.GetOrdinal("DocumentsId"));
                    model.CompanyId   = dr.GetString(dr.GetOrdinal("CompanyId"));
                    model.FontSize    = dr.IsDBNull(dr.GetOrdinal("FontSize")) ? "" : dr.GetString(dr.GetOrdinal("FontSize"));
                    model.Company     = dr.IsDBNull(dr.GetOrdinal("Company")) ? "" : dr.GetString(dr.GetOrdinal("Company"));
                    model.Title       = dr.IsDBNull(dr.GetOrdinal("Title")) ? "" : dr.GetString(dr.GetOrdinal("Title"));
                    model.FileType    = (EyouSoft.Model.EnumType.GovStructure.FileType)dr.GetByte(dr.GetOrdinal("FileType"));
                    model.AttnId      = dr.IsDBNull(dr.GetOrdinal("AttnId")) ? "" : dr.GetString(dr.GetOrdinal("AttnId"));
                    model.AttnName    = dr.IsDBNull(dr.GetOrdinal("AttnName")) ? "" : dr.GetString(dr.GetOrdinal("AttnName"));
                    model.OperatorID  = !dr.IsDBNull(dr.GetOrdinal("OperatorID")) ? dr.GetString(dr.GetOrdinal("OperatorID")) : "";
                    if (!dr.IsDBNull(dr.GetOrdinal("IssueTime")))
                    {
                        model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    }
                    model.ApproveState            = (EyouSoft.Model.EnumType.GovStructure.ApprovalStatus)dr.GetByte(dr.GetOrdinal("ApproveState"));
                    model.ComAttachList           = this.GetAttachList(dr["ComAttachXML"].ToString(), model.DocumentsId, ItemType);
                    model.GovDocumentsApproveList = this.GetGovDocumentsApproveList(dr["GovDocumentsApproveXML"].ToString());
                    ResultList.Add(model);
                    model = null;
                }
            };
            return(ResultList);
        }
Esempio n. 7
0
        /// <summary>
        /// 根据 文件ID 获取文件实体信息
        /// </summary>
        /// <param name="ID">文件ID</param>
        /// <param name="ItemType">附件类型</param>
        /// <returns></returns>
        public EyouSoft.Model.GovStructure.MGovDocuments GetGovDocumentsModel(string ID, EyouSoft.Model.EnumType.ComStructure.AttachItemType ItemType)
        {
            EyouSoft.Model.GovStructure.MGovDocuments model = null;
            StringBuilder StrSql = new StringBuilder();

            StrSql.Append("SELECT DocumentsId,CompanyId,FontSize,Company,Title,FileType,AttnId,OperatorID,IssueTime,ApproveState, ");
            StrSql.Append(" (SELECT TOP 1 Name FROM tbl_GovFile WHERE ID=a.AttnId )AS AttnName, ");
            StrSql.AppendFormat(" (SELECT Name,FilePath,Size,Downloads FROM tbl_ComAttach WHERE ItemType={0} AND ItemId=a.DocumentsId FOR XML RAW,ROOT('ROOT'))AS ComAttachXML,", (int)ItemType);
            StrSql.Append(" (SELECT DocumentsId,ApproveID,ApproveName,ApproveTime,ApprovalViews,ApproveState FROM tbl_GovDocumentsApprove WHERE DocumentsId=a.DocumentsId FOR XML RAW,ROOT('ROOT'))AS GovDocumentsApproveXML ");
            StrSql.AppendFormat(" FROM tbl_GovDocuments a WHERE a.DocumentsId='{0}' ", ID);
            DbCommand dc = this._db.GetSqlStringCommand(StrSql.ToString());

            using (IDataReader dr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(dc, this._db))
            {
                if (dr.Read())
                {
                    model             = new EyouSoft.Model.GovStructure.MGovDocuments();
                    model.DocumentsId = dr.GetString(dr.GetOrdinal("DocumentsId"));
                    model.CompanyId   = dr.GetString(dr.GetOrdinal("CompanyId"));
                    model.FontSize    = dr.IsDBNull(dr.GetOrdinal("FontSize")) ? "" : dr.GetString(dr.GetOrdinal("FontSize"));
                    model.Company     = dr.IsDBNull(dr.GetOrdinal("Company")) ? "" : dr.GetString(dr.GetOrdinal("Company"));
                    model.Title       = dr.IsDBNull(dr.GetOrdinal("Title")) ? "" : dr.GetString(dr.GetOrdinal("Title"));
                    model.FileType    = (EyouSoft.Model.EnumType.GovStructure.FileType)dr.GetByte(dr.GetOrdinal("FileType"));
                    model.AttnId      = dr.IsDBNull(dr.GetOrdinal("AttnId")) ? "" : dr.GetString(dr.GetOrdinal("AttnId"));
                    model.AttnName    = dr.IsDBNull(dr.GetOrdinal("AttnName")) ? "" : dr.GetString(dr.GetOrdinal("AttnName"));
                    model.OperatorID  = !dr.IsDBNull(dr.GetOrdinal("OperatorID")) ? dr.GetString(dr.GetOrdinal("OperatorID")) : "";
                    if (!dr.IsDBNull(dr.GetOrdinal("IssueTime")))
                    {
                        model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    }
                    model.ApproveState            = (EyouSoft.Model.EnumType.GovStructure.ApprovalStatus)dr.GetByte(dr.GetOrdinal("ApproveState"));
                    model.ComAttachList           = this.GetAttachList(dr["ComAttachXML"].ToString(), model.DocumentsId, ItemType);
                    model.GovDocumentsApproveList = this.GetGovDocumentsApproveList(dr["GovDocumentsApproveXML"].ToString());
                }
            };
            return(model);
        }