Ejemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(TravelAgent.Model.TourGuideRoute model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TourGuideRoute ");
            strSql.Append(" set guideid=@guideid,routetime=@routetime,title=@title,contents=@contents ");
            strSql.Append(" where id=@id ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@guideid",   SqlDbType.Int),
                new SqlParameter("@routetime", SqlDbType.DateTime),
                new SqlParameter("@title",     SqlDbType.VarChar,500),
                new SqlParameter("@contents",  SqlDbType.Text),
                new SqlParameter("@id",        SqlDbType.Int)
            };
            parameters[0].Value = model.guideid;
            parameters[1].Value = model.routetime;
            parameters[2].Value = model.title;
            parameters[3].Value = model.contents;
            parameters[4].Value = model.id;


            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 取得所有游记配置列表
        /// </summary>
        /// <param name="PId">父ID</param>
        /// <param name="KId">种类ID</param>
        /// <returns></returns>
        public List <TravelAgent.Model.TourGuideRoute> GetList()
        {
            List <TravelAgent.Model.TourGuideRoute> dt = new List <Model.TourGuideRoute>();
            string    sql = "select * from TourGuideRoute ";
            DataTable dts = DbHelperSQL.Query(sql).Tables[0];

            for (int i = 0; i < dts.Rows.Count; i++)
            {
                int sid = Convert.ToInt32(dts.Rows[i]["id"]);
                TravelAgent.Model.TourGuideRoute ty = GetModel(sid);
                dt.Add(ty);
            }
            return(dt);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(TravelAgent.Model.TourGuideRoute model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TourGuideRoute(");
            strSql.Append("guideid,routetime,title,contents)");
            strSql.Append(" values (");
            strSql.Append("@guideid,@routetime,@title,@contents)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@guideid",   SqlDbType.Int),
                new SqlParameter("@routetime", SqlDbType.DateTime),
                new SqlParameter("@title",     SqlDbType.VarChar,500),
                new SqlParameter("@contents",  SqlDbType.Text)
            };
            parameters[0].Value = model.guideid;
            parameters[1].Value = model.routetime;
            parameters[2].Value = model.title;
            parameters[3].Value = model.contents;


            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TravelAgent.Model.TourGuideRoute model)
 {
     TourGuideTempDAL.Update(model);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(TravelAgent.Model.TourGuideRoute model)
 {
     TourGuideTempDAL.Add(model);
     return(TourGuideTempDAL.GetMaxID("Id"));
 }