Beispiel #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ICS_THEME_CONENT model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ICS_THEME_CONTENT set ");
            strSql.Append("USERID=" + model.USERID + ",");
            strSql.Append("THEMEID=" + model.THEMEID + ",");
            strSql.Append("DISPLAY_NAME='" + model.DISPLAY_NAME + "',");
            strSql.Append("AUTO_REFRESH=" + model.AUTO_REFRESH + ",");
            strSql.Append("AUTO_REFRESH_INTERVAL=" + model.AUTO_REFRESH_INTERVAL + ",");
            strSql.Append("CONTENTID=" + model.CONTENTID + "");
            strSql.Append(" where ID=" + model.ID + " ");
            DbHelperSQL.ExecuteSql(strSql.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        private ICS_THEME_CONENT GetModel(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  ID,USERID,THEMEID,DISPLAY_NAME,AUTO_REFRESH,AUTO_REFRESH_INTERVAL,CONTENTID");
            strSql.Append(" FROM ICS_THEME_CONTENT ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by ID");
            ICS_THEME_CONENT model = new ICS_THEME_CONENT();
            DataSet          ds    = DbHelperSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.DISPLAY_NAME = ds.Tables[0].Rows[0]["DISPLAY_NAME"].ToString();
                if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["USERID"].ToString() != "")
                {
                    model.USERID = int.Parse(ds.Tables[0].Rows[0]["USERID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["THEMEID"].ToString() != "")
                {
                    model.THEMEID = int.Parse(ds.Tables[0].Rows[0]["THEMEID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AUTO_REFRESH"].ToString() != "")
                {
                    model.AUTO_REFRESH = int.Parse(ds.Tables[0].Rows[0]["AUTO_REFRESH"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AUTO_REFRESH_INTERVAL"].ToString() != "")
                {
                    model.AUTO_REFRESH_INTERVAL = int.Parse(ds.Tables[0].Rows[0]["AUTO_REFRESH_INTERVAL"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CONTENTID"].ToString() != "")
                {
                    model.CONTENTID = int.Parse(ds.Tables[0].Rows[0]["CONTENTID"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        private List <ICS_THEME_CONENT> GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ID,USERID,THEMEID,DISPLAY_NAME,AUTO_REFRESH,AUTO_REFRESH_INTERVAL,CONTENTID");
            strSql.Append(" FROM ICS_THEME_CONTENT ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            List <ICS_THEME_CONENT> list = new List <ICS_THEME_CONENT>();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                ICS_THEME_CONENT model = new ICS_THEME_CONENT();
                model.DISPLAY_NAME = ds.Tables[0].Rows[i]["DISPLAY_NAME"].ToString();
                if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["USERID"].ToString() != "")
                {
                    model.USERID = int.Parse(ds.Tables[0].Rows[0]["USERID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["THEMEID"].ToString() != "")
                {
                    model.THEMEID = int.Parse(ds.Tables[0].Rows[0]["THEMEID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AUTO_REFRESH"].ToString() != "")
                {
                    model.AUTO_REFRESH = int.Parse(ds.Tables[0].Rows[0]["AUTO_REFRESH"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AUTO_REFRESH_INTERVAL"].ToString() != "")
                {
                    model.AUTO_REFRESH_INTERVAL = int.Parse(ds.Tables[0].Rows[0]["AUTO_REFRESH_INTERVAL"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CONTENTID"].ToString() != "")
                {
                    model.CONTENTID = int.Parse(ds.Tables[0].Rows[0]["CONTENTID"].ToString());
                }
                list.Add(model);
            }
            return(list);
        }
Beispiel #4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(ICS_THEME_CONENT model)
        {
            model.ID = GetMaxID() + 1;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ICS_THEME_CONTENT(");
            strSql.Append("ID,USERID,THEMEID,DISPLAY_NAME,AUTO_REFRESH,AUTO_REFRESH_INTERVAL,CONTENTID");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(model.ID + ",");
            strSql.Append(model.USERID + ",");
            strSql.Append(model.THEMEID + ",");
            strSql.Append("'" + model.DISPLAY_NAME + "',");
            strSql.Append(model.AUTO_REFRESH + ",");
            strSql.Append(model.AUTO_REFRESH_INTERVAL + ",");
            strSql.Append(model.CONTENTID);
            strSql.Append(")");
            DbHelperSQL.ExecuteSql(strSql.ToString());
        }
Beispiel #5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ICS_THEME_CONENT model)
 {
     dal.Update(model);
 }
Beispiel #6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(ICS_THEME_CONENT model)
 {
     dal.Add(model);
 }