Example #1
0
 /// <summary>
 /// 绑定交流实体
 /// </summary>
 private void Bind()
 {
     tid = Utils.GetInt(Utils.GetQueryStringValue("tid"));
     #region 实体附值
     if (tid > 0)
     {
         exModel = weBll.GetModel(tid);
         weBll.SetClicks(tid);
     }
     #endregion
 }
Example #2
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model">交流专区实体</param>
        /// <returns>true:成功 false:失败</returns>
        public bool Update(EyouSoft.Model.PersonalCenterStructure.WorkExchange model)
        {
            DbCommand dc = this._db.GetStoredProcCommand("proc_WorkExchange_Update");

            this._db.AddInParameter(dc, "ExchangeId", DbType.Int32, model.ExchangeId);
            this._db.AddInParameter(dc, "CompanyId", DbType.Int32, model.CompanyId);
            this._db.AddInParameter(dc, "Title", DbType.String, model.Title);
            this._db.AddInParameter(dc, "Description", DbType.String, model.Description);
            this._db.AddInParameter(dc, "OperatorId", DbType.Int32, model.OperatorId);
            this._db.AddInParameter(dc, "OperatorName", DbType.String, model.OperatorName);
            this._db.AddInParameter(dc, "IsAnonymous", DbType.String, model.IsAnonymous ? "1" : "0");
            this._db.AddInParameter(dc, "AcceptXML", DbType.String, this.CreateAcceptXML(model.AcceptList));
            this._db.AddOutParameter(dc, "Result", DbType.Int32, 4);
            DbHelper.RunProcedure(dc, this._db);
            object obj = this._db.GetParameterValue(dc, "Result");

            return(int.Parse(obj.ToString()) > 0 ? true : false);
        }
Example #3
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model">交流专区实体</param>
        /// <returns>true:成功 false:失败</returns>
        public bool Update(EyouSoft.Model.PersonalCenterStructure.WorkExchange model)
        {
            if (model == null)
            {
                return(false);
            }
            bool Result = idal.Update(model);

            if (Result)
            {
                HandleLogsBll.Add(
                    new EyouSoft.Model.CompanyStructure.SysHandleLogs()
                {
                    ModuleId     = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_工作交流,
                    EventCode    = Model.CompanyStructure.SysHandleLogsNO.EventCode,
                    EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_工作交流.ToString() + "修改了工作交流!编号为:" + model.ExchangeId,
                    EventTitle   = "修改" + Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_工作交流.ToString() + "数据"
                });
            }
            return(Result);
        }
Example #4
0
        /// <summary>
        /// 分页获取交流专区列表
        /// </summary>
        /// <param name="pageSize">每页现实条数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="RecordCount">总记录数</param>
        /// <param name="CompanyId">公司编号 =0返回所有</param>
        /// <param name="OperatorId">操作人编号 =0返回所有</param>
        /// <returns>交流专区列表</returns>
        public IList <EyouSoft.Model.PersonalCenterStructure.WorkExchange> GetList(int pageSize, int pageIndex, ref int RecordCount, int CompanyId, int OperatorId)
        {
            IList <EyouSoft.Model.PersonalCenterStructure.WorkExchange> list = new List <EyouSoft.Model.PersonalCenterStructure.WorkExchange>();
            string        tableName  = "tbl_WorkExchange";
            string        fields     = "ExchangeId,Title,OperatorName,IsAnonymous,Clicks,Replys,CreateTime";
            string        primaryKey = "ExchangeId";
            string        orderbyStr = " CreateTime DESC ";
            StringBuilder strWhere   = new StringBuilder(" IsDelete='0' ");

            if (CompanyId > 0)
            {
                strWhere.AppendFormat(" and CompanyId={0} ", CompanyId);
            }
            //TODO:需根据OperatorId查询对应的权限集合
            if (OperatorId > 0)
            {
                strWhere.AppendFormat("");
            }
            using (IDataReader dr = DbHelper.ExecuteReader(this._db, pageSize, pageIndex, ref RecordCount, tableName, primaryKey, fields, strWhere.ToString(), orderbyStr))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.PersonalCenterStructure.WorkExchange model = new EyouSoft.Model.PersonalCenterStructure.WorkExchange();
                    model.ExchangeId   = dr.GetInt32(dr.GetOrdinal("ExchangeId"));
                    model.Title        = dr[dr.GetOrdinal("Title")].ToString();
                    model.OperatorName = dr[dr.GetOrdinal("OperatorName")].ToString();
                    model.IsAnonymous  = dr[dr.GetOrdinal("IsAnonymous")].ToString() == "1" ? true : false;
                    model.Clicks       = dr.GetInt32(dr.GetOrdinal("Clicks"));
                    model.Replys       = dr.GetInt32(dr.GetOrdinal("Replys"));
                    model.CreateTime   = dr.GetDateTime(dr.GetOrdinal("CreateTime"));
                    list.Add(model);
                    model = null;
                }
            }
            return(list);
        }