/// <summary> /// 获取公告信息对象 /// </summary> /// <param name="Hc_Id"></param> /// <returns></returns> public BulletinInfoModel GetBulletinInfoModel(string strBulietin_Id) { StringBuilder strSql = new StringBuilder(); strSql.Append(@"Select br.id as ReceiverId, bi.ID, bi.Title, bi.CONTENT, br.IS_READ, (case br.IS_READ when '2' then '已阅读' when '1' then '未阅读' end) As ReadName, bi.ISSUER_ID, bi.ISSUER_NAME, bi.ISSUE_DATE From HC_BULLETIN_INFO bi,HC_BULLETIN_RECEIVER br Where bi.ID=br.BULLETIN_ID"); if (!string.IsNullOrEmpty(strBulietin_Id)) { strSql.AppendFormat(" and bi.ID='{0}'", strBulietin_Id); } else { return(null); } BulletinInfoModel model = null; model = base.DbFacade.SQLExecuteObject(strSql.ToString(), new MapRow(GetBulletinInfoModel)) as BulletinInfoModel; return(model); }
/// <summary> /// 获取库房信息对象 /// </summary> /// <param name="Hc_Id"></param> /// <returns></returns> //public WarehouseModel GetWarehouseInfoModel(string Hc_Id) //{ // List<DbParameter> parameters = new List<DbParameter>(); // StringBuilder strSql = new StringBuilder(); // strSql.Append("Select"); // strSql.Append(" bi.ID,"); // strSql.Append(" bi.Title,"); // strSql.Append(" bi.CONTENT,"); // strSql.Append(" br.IS_READ,"); // strSql.Append(" (case br.IS_READ when '0' then '已阅读' when '1' then '未阅读' end) As ReadName,"); // strSql.Append(" bi.ISSUER_ID,"); // strSql.Append(" bi.ISSUER_NAME,"); // strSql.Append(" bi.ISSUE_DATE"); // strSql.Append(" From HC_BULLETIN_INFO bi,HC_BULLETIN_RECEIVER br"); // strSql.Append(" Where bi.ID=br.HC_ID"); // if (!string.IsNullOrEmpty(Hc_Id)) // { // strSql.Append(" and bi.ID=:hc_id"); // DbParameter strhc_id = DbFacade.CreateParameter(); // strhc_id.ParameterName = "hc_id"; // strhc_id.DbType = DbType.String; // strhc_id.Value = Hc_Id; // parameters.Add(strhc_id); // } // else // { // return null; // } // BulletinInfoModel model = null; // model = base.DbFacade.SQLExecuteObject(strSql.ToString(), new MapRow(GetBulletinInfoModel), parameters.ToArray()) as BulletinInfoModel; // return model; //} /// <summary> /// 采购目录信息对象 /// </summary> /// <param name="reader">The reader.</param> /// <param name="rowNumber">The row number.</param> /// <returns></returns> private object GetBulletinInfoModel(IDataReader reader, int row) { BulletinInfoModel model = new BulletinInfoModel(); model.Id = Convert.ToString(reader["ID"]); model.Title = Convert.ToString(reader["Title"]); model.Content = Convert.ToString(reader["Content"]); model.IsRead = Convert.ToString(reader["IS_READ"]); model.ReadName = Convert.ToString(reader["ReadName"]); model.IsSuerId = Convert.ToString(reader["ISSUER_ID"]); model.IsSuerName = Convert.ToString(reader["ISSUER_NAME"]); model.IsSuerDate = Convert.ToString(reader["ISSUE_DATE"]); return(model); }
/// <summary> /// 初始化显示信息 /// </summary> /// <param name="strBulietin_Id">公告ID</param> private void IniData(string strBulletionID) { //清空文本 IniTextClear(); //获取公告对象 model = BulletinInfoBLL.GetInstance().GetBulletinInfoModel(strBulletionID); if (model != null) { this.labTitle.Text = model.Title; this.webContent.DocumentText = model.Content.ToString(); this.labReadName.Text = model.ReadName; this.labISSUER_NAME.Text = model.IsSuerName; this.labISSUE_DATE.Text = model.IsSuerDate; //修改已阅读状态 1未阅读 2已阅读 if (model.IsRead.Equals("1")) { BulletinInfoBLL.GetInstance().ModifyBulletinReceiver(model.ReceiverId); } } }