Esempio n. 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(RoadSolution.Model.LeaderShip model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update LeaderShip set ");
            strSql.Append("LeaderID='" + model.LeaderID + "'");
            strSql.Append(" where UserID='" + model.UserID + "'");
            DbHelperSQL.ExecuteSql(strSql.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public string Add(RoadSolution.Model.LeaderShip model)
        {
            model.UserID = GetMaxId().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into LeaderShip(");
            strSql.Append("UserID,LeaderID");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append("'" + model.UserID + "',");
            strSql.Append("'" + model.LeaderID + "'");
            strSql.Append(")");
            DbHelperSQL.ExecuteSql(strSql.ToString());
            return(model.UserID);
        }
Esempio n. 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public RoadSolution.Model.LeaderShip GetModel(string UserID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * from LeaderShip ");
            strSql.Append(" where UserID='" + UserID + "'");
            RoadSolution.Model.LeaderShip model = new RoadSolution.Model.LeaderShip();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());

            model.UserID = UserID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.LeaderID = ds.Tables[0].Rows[0]["LeaderID"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(RoadSolution.Model.LeaderShip model)
 {
     dal.Update(model);
 }
Esempio n. 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public string Add(RoadSolution.Model.LeaderShip model)
 {
     return(dal.Add(model));
 }