/// <summary> /// 更新一条数据 /// </summary> public int Update(CityInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update eccm_city_info set "); strSql.Append("areaName=@areaName,"); strSql.Append("pID=@pID,"); strSql.Append("isDel=@isDel,"); strSql.Append("sort=@sort"); strSql.Append(" where areaID=@areaID"); MySqlParameter[] parameters = { new MySqlParameter("@areaName", MySqlDbType.VarChar, 50), new MySqlParameter("@pID", MySqlDbType.Int32, 10), new MySqlParameter("@isDel", MySqlDbType.Bit), new MySqlParameter("@sort", MySqlDbType.Int32, 10), new MySqlParameter("@areaID", MySqlDbType.Int32, 10) }; parameters[0].Value = model.areaName; parameters[1].Value = model.pID; parameters[2].Value = model.isDel; parameters[3].Value = model.sort; parameters[4].Value = model.areaID; return(MySQLHelper.ExecuteNonQuery(strSql.ToString(), parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(CityInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into eccm_city_info("); strSql.Append("areaName,pID,isDel,sort)"); strSql.Append(" values ("); strSql.Append("@areaName,@pID,@isDel,@sort)"); MySqlParameter[] parameters = { new MySqlParameter("@areaName", MySqlDbType.VarChar, 50), new MySqlParameter("@pID", MySqlDbType.Int32, 10), new MySqlParameter("@isDel", MySqlDbType.Bit), new MySqlParameter("@sort", MySqlDbType.Int32, 10) }; parameters[0].Value = model.areaName; parameters[1].Value = model.pID; parameters[2].Value = model.isDel; parameters[3].Value = model.sort; return(MySQLHelper.ExecuteNonQuery(strSql.ToString(), parameters)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(CityInfoModel model) { return(cityinfo_dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(CityInfoModel model) { return(cityinfo_dal.Add(model)); }