コード例 #1
0
 public static int UpdateTbl_Page(Tbl_Page tbl_page)
 {
     WebCommon.Public.WriteLog("Ð޸ĵ¥Ò³£º" + tbl_page.P_Title);
     tbl_page.DealUser = WebCommon.Public.GetUserName();
     tbl_page.DealTime = DateTime.Now;
     return(new Tbl_PageService().UpdateTbl_PageById(tbl_page));
 }
コード例 #2
0
        /// <summary>
        ///根据SQL语句返回集合
        /// </summary>
        private IList <Tbl_Page> getTbl_PagesBySql(string sql)
        {
            IList <Tbl_Page> list = new List <Tbl_Page>();
            DataSet          ds   = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql);

            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    Tbl_Page tbl_page = new Tbl_Page();
                    tbl_page.ID            = Convert.ToInt32(dr["ID"]);
                    tbl_page.P_Title       = Convert.ToString(dr["P_Title"]);
                    tbl_page.P_Keyword     = Convert.ToString(dr["P_Keyword"]);
                    tbl_page.P_Description = Convert.ToString(dr["P_Description"]);
                    tbl_page.P_Content     = Convert.ToString(dr["P_Content"]);
                    tbl_page.DealFlag      = Convert.ToInt32(dr["DealFlag"]);
                    tbl_page.DealUser      = Convert.ToString(dr["DealUser"]);
                    tbl_page.DealTime      = Convert.ToDateTime(dr["DealTime"]);
                    tbl_page.AddDate       = Convert.ToDateTime(dr["AddDate"]);
                    list.Add(tbl_page);
                }
            }
            return(list);
        }
コード例 #3
0
        public int AddTbl_Page(Tbl_Page tbl_page)
        {
            string sql = "insert into [Tbl_Page] ([P_Title],[P_Keyword],[P_Description],[P_Content],[DealUser]) values (@P_Title,@P_Keyword,@P_Description,@P_Content,@DealUser)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@P_Title", tbl_page.P_Title),
                new SqlParameter("@P_Keyword", tbl_page.P_Keyword),
                new SqlParameter("@P_Description", tbl_page.P_Description),
                new SqlParameter("@P_Content", tbl_page.P_Content),
                new SqlParameter("@DealUser", tbl_page.DealUser)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
コード例 #4
0
        public int UpdateTbl_PageById(Tbl_Page tbl_page)
        {
            string sql = "update [Tbl_Page] set [P_Title]=@P_Title,[P_Keyword]=@P_Keyword,[P_Description]=@P_Description,[P_Content]=@P_Content,[DealUser]=@DealUser,[DealTime]=@DealTime where DealFlag=0 and [ID]=@ID";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@P_Title", tbl_page.P_Title),
                new SqlParameter("@P_Keyword", tbl_page.P_Keyword),
                new SqlParameter("@P_Description", tbl_page.P_Description),
                new SqlParameter("@P_Content", tbl_page.P_Content),
                new SqlParameter("@DealUser", tbl_page.DealUser),
                new SqlParameter("@DealTime", tbl_page.DealTime.ToString()),
                new SqlParameter("@ID", tbl_page.ID)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
コード例 #5
0
 public static int AddTbl_Page(Tbl_Page tbl_page)
 {
     WebCommon.Public.WriteLog("Ìí¼Óµ¥Ò³£º" + tbl_page.P_Title);
     return(new Tbl_PageService().AddTbl_Page(tbl_page));
 }