public virtual void Add(StoreModels store) { string sqlStr = string.Format("insert into m_store values({0},'{1}','{2}',{3},'{4}',{5},'{6}','{7}',{8})", store.areaKeyID, store.storeCName, store.storeEName, store.categoryID, store.logo, store.brandsID, store.address, store.phoneNumber, store.arrivalNum); SqlSeverProvider.ExecuteNonQuery(sqlStr); }
public virtual bool UpdatePosition(string phone, int positionId) { string sqlStr = string.Format("update m_user set u_position ={0} where u_mobilePhone='{1}'", positionId, phone); var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); if (result > 0) { return(true); } return(false); }
//------------------------------------------------------ //数据库字段 englisgName 改为englishName // //--------------------------------------------------------- #region Add public virtual void Add(BrandModels brand) { string sqlStr = "insert into m_brands values (@chineseName,@englishName,@logo)"; SqlParameter[] parm = { new SqlParameter("@chineseName", brand.chineseName), new SqlParameter("@englishName", brand.englishName), new SqlParameter("@logo", brand.logo) }; var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); }
/// <summary> /// Add user /// </summary> /// <param name="user"></param> public virtual void Add(UserModels user) { string sqlStr = "insert into m_user(u_mobilePhone,u_password,u_nickName) values(@mobilePhone,@password,@nickName)"; SqlParameter[] parm = { new SqlParameter("@mobilePhone", user.mobilePhone), new SqlParameter("@password", user.password), new SqlParameter("@nickName", user.nickName) }; var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); // 是否返回 true or }
public void Add(TradeAreaModels trade) { string sqlString = string.Format("insert into m_tradeArea values({0},{1},{2},{3},{4},{5},{6},{7}", trade.TradeAreaProvince, trade.TradeAreaCity, "'" + trade.TradeAreaCityName + "'", "'" + trade.TradeAreaName + "'", "'" + trade.TradeAreaAddress + "'", trade.FloorCount, trade.FirstFloor, "'" + trade.TradeAreaLogo + "')"); SqlSeverProvider.ExecuteNonQuery(sqlString); }
public virtual void Add(AreaModels area) { int ismark = 0; if (area.IsMark == true) { ismark = 1; } string sqlString = string.Format("insert into m_area values({0},{1},{2},{3},{4},{5},{6},{7},{8})", area.TradeAreaID, area.TradeAreaFloor, area.AradID, area.Category, area.StartX, area.StartY, area.Width, area.Height, ismark); SqlSeverProvider.ExecuteNonQuery(sqlString); }
/// <summary> /// Update user profile according to mobilePhone /// </summary> /// <param name="phone"></param> /// <param name="newUser"></param> public virtual void UpdateByPhone(string phone, UserModels newUser) { string sqlStr = "update m_user set u_mobilePhone=@mobilePhone,u_password=@password," + "u_nickName=@nickName,u_cityName=@cityName,u_email=@email,u_avatar=@avatar where u_mobilePhone=" + phone; SqlParameter[] parm = { new SqlParameter("@mobilePhone", newUser.mobilePhone), new SqlParameter("@password", newUser.password), new SqlParameter("@nickName", newUser.nickName), new SqlParameter("@cityName", newUser.cityName), new SqlParameter("@email", newUser.email), new SqlParameter("@avatar", newUser.avatar) }; var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); }
public void Update(int id, TradeAreaModels trade) { string sqlString = string.Format("update m_tradeArea set t_tradeAreaProvince={0}, t_tradeAreaCity={1}, t_tradeAreaCityName={2}, " + "t_tradeAreaName={3}, t_tradeAreaAddress={4}, t_floorCount={5}, t_firstFloor={6}, t_tradeAreaLogo={7} where t_tradeAreaId={8}", trade.TradeAreaProvince, trade.TradeAreaCity, "'" + trade.TradeAreaCityName + "'", "'" + trade.TradeAreaName + "'", "'" + trade.TradeAreaAddress + "'", trade.FloorCount, trade.FirstFloor, "'" + trade.TradeAreaLogo + "'", id); SqlSeverProvider.ExecuteNonQuery(sqlString); }
public virtual void Update(int ID, AreaModels area) { int ismark = 0; if (area.IsMark == true) { ismark = 1; } string sqlString = string.Format("update m_area set a_tradeAreaId={0},a_tradeAreaFloor={1},a_areaId={2}," + "a_areaCategory={3},a_startX={4},a_startY={5},a_width={6},a_height={7},a_isMark={8}" + " where a_allAreaKeyId={9}", area.TradeAreaID, area.TradeAreaFloor, area.AradID, area.Category, area.StartX, area.StartY, area.Width, area.Height, ismark, ID); SqlSeverProvider.ExecuteNonQuery(sqlString); }
public virtual void Update(int id, StoreModels newStore) { string sqlStr = string.Format("update m_store set s_areaKeyId="); SqlSeverProvider.ExecuteNonQuery(sqlStr); }
/// <summary> /// change the password /// </summary> /// <param name="phone"></param> /// <param name="newPwd"></param> public virtual void ChangePassword(string phone, string newPwd) { string sqlStr = string.Format("update m_user set u_password={0} where u_mobilePhone={1}", newPwd, phone); var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); }
public virtual void Remove(int id) { string sqlStr = "delete from m_store where s_storeId=" + id + ""; SqlSeverProvider.ExecuteNonQuery(sqlStr); }
/// <summary> /// delete user by mobilePhone /// </summary> /// <param name="phone"></param> public virtual void DeleteByPhone(string phone) { string sqlStr = string.Format("delete from m_user where u_mobilePhone={0}", phone); SqlSeverProvider.ExecuteNonQuery(sqlStr); }
public virtual void Update(int id, BrandModels newBrand) { string sqlStr = string.Format("update m_brands set b_chineseName={0},b_englisgName={1},b_logo={3}", newBrand.chineseName, newBrand.englishName, newBrand.logo); var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); }
public virtual void Remove(int id) { string sqlStr = string.Format("delete from m_brands where b_brandsId={0}", id); var result = SqlSeverProvider.ExecuteNonQuery(sqlStr); }
public virtual void Remove(int ID) { string sqlString = "delete from m_area where a_allAreaKeyId=" + ID; SqlSeverProvider.ExecuteNonQuery(sqlString); }
public void Remove(int id) { string sqlString = "delete from m_tradeArea where t_tradeAreaId=" + id; SqlSeverProvider.ExecuteNonQuery(sqlString); }