/// <summary> /// 修改数据 /// </summary> /// <param name="mti"></param> /// <returns></returns> public int Update(MemberTypeInfo mti) { //构造修改sql语句 string sql = "UPDATE MemberTypeInfo SET MTitle=@MTitle,MDiscount=@MDiscount WHERE MId =@MId"; //构造参数 MySqlParameter[] ps = { new MySqlParameter("@MTitle", mti.MTitle), new MySqlParameter("@MDiscount", mti.MDiscount), new MySqlParameter("@MId", mti.MId), }; //调用操作数据方法 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 添加数据 /// </summary> /// <param name="di"></param> /// <returns></returns> public int Insert(DishInfo di) { //构造sql语句及对应参数 string sql = "INSERT INTO DishInfo (DTitle, DTypeId, DPrice, DChar, DIsDelete) VALUES (@DTitle, @DTypeId, @DPrice, @DChar, 0)"; MySqlParameter[] ps = { new MySqlParameter("@DTitle", di.DTitle), new MySqlParameter("@DTypeId", di.DTypeId), new MySqlParameter("@DPrice", di.DPrice), new MySqlParameter("@DChar", di.DChar), }; //执行,并返回影响条数 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 添加数据 /// </summary> /// <param name="mi"></param> /// <returns></returns> public int Insert(MemberInfo mi) { //构造sql语句及参数 string sql = "INSERT INTO MemberInfo (MTypeId, MName, MPhone, MMoney, MIsDelete) VALUES (@MTypeId, @MName, @MPhone, @MMoney, 0)"; MySqlParameter[] ps = { new MySqlParameter("@MTypeId", mi.MTypeId), new MySqlParameter("@MName", mi.MName), new MySqlParameter("@MPhone", mi.MPhone), new MySqlParameter("@MMoney", mi.MMoney), }; //执行并返回 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 插入数据 /// </summary> /// <param name="mi">ManagerInfo类型的对象</param> /// <returns></returns> public int Insert(ManagerInfo mi) { //构造insert语句 string sql = "insert into ManagerInfo(MName,MPwd,MType) values(@MName,@MPwd,@MType)"; //构造sql语句的参数 MySqlParameter[] ps = //使用数组初始化器 { new MySqlParameter("@MName", mi.MName), new MySqlParameter("@MPwd", Md5Helper.EncryptString(mi.MPwd)), new MySqlParameter("@MType", mi.MType) }; //执行插入操作 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 修改数据 /// </summary> /// <param name="ti"></param> /// <returns></returns> public int Update(TableInfo ti) { //构造sql语句及参数 string sql = "UPDATE TableInfo SET TTitle = @TTitle, THallId = @THallId, TIsFree = @TIsFree WHERE TId = @TId "; MySqlParameter[] ps = { new MySqlParameter("@TId", ti.TId), new MySqlParameter("@TTitle", ti.TTitle), new MySqlParameter("@THallId", ti.THallId), new MySqlParameter("TIsFree", ti.TIsFree), }; //执行并返回 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 添加数据 /// </summary> /// <param name="ti"></param> /// <returns></returns> public int Insert(TableInfo ti) { //构造sql语句及参数 string sql = "INSERT INTO TableInfo (TTitle, THallId, TIsFree, TIsDelete ) VALUES " + "(@TTitle, @THallId, @TIsFree, 0)"; MySqlParameter[] ps = { new MySqlParameter("@TTitle", ti.TTitle), new MySqlParameter("@THallId", ti.THallId), new MySqlParameter("TIsFree", ti.TIsFree), }; //执行并返回 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 修改数据 /// </summary> /// <param name="di"></param> /// <returns></returns> public int Update(DishInfo di) { //构造sql语句及参数 string sql = "UPDATE DishInfo SET DTitle = @DTitle, DTypeId = @DTypeId, DPrice = @DPrice, DChar = @DChar WHERE DId = @DId"; MySqlParameter[] ps = { new MySqlParameter("@DId", di.DId), new MySqlParameter("@DTitle", di.DTitle), new MySqlParameter("@DTypeId", di.DTypeId), new MySqlParameter("@DPrice", di.DPrice), new MySqlParameter("@DChar", di.DChar), }; //执行,并返回影响条数 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }
/// <summary> /// 修改数据 /// </summary> /// <param name="mi"></param> /// <returns></returns> public int Update(MemberInfo mi) { //构造sql语句及参数 string sql = "UPDATE MemberInfo SET MTypeId = @MTypeId, MName = @MName, MPhone = @MPhone, MMoney = @MMoney WHERE MId= @MId"; MySqlParameter[] ps = { new MySqlParameter("@MId", mi.MId), new MySqlParameter("@MTypeId", mi.MTypeId), new MySqlParameter("@MName", mi.MName), new MySqlParameter("@MPhone", mi.MPhone), new MySqlParameter("@MMoney", mi.MMoney), }; //执行并返回 return(MysqlHelper.ExecuteNonQuery(sql, ps)); }