/// <summary> /// 更新用户信息 /// </summary> /// <param name="Delivery"></param> /// <returns></returns> public int UpdateDelivery(Delivery Delivery) { string sql = $"{ CreateSqlString.UpdateSqlString(Delivery) } WHERE DeliveryId =@DeliveryId"; var pars = CreateSqlString.SqlParameterArray(Delivery); return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 添加信息 /// </summary> /// <param name="Delivery"></param> /// <returns></returns> public int AddDelivery(Delivery Delivery) { string sql = CreateSqlString.InsertSqlString(Delivery); var pars = CreateSqlString.SqlParameterArray(Delivery); return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 添加信息 /// </summary> /// <param name="Product"></param> /// <returns></returns> public int AddProduct(Product Product) { //string sql = "insert into Product(ProductId,Title,CateId,MarketPrice,Price,Content,PostTime,Stock) values(@ProductId,@Title,@CateId,@MarketPrice,@Price,@Content,@PostTime,@Stock)"; string sql = CreateSqlString.InsertSqlString(Product); var pars = CreateSqlString.SqlParameterArray(Product); //MySqlParameter[] pars = { // new MySqlParameter("@ProductId",MySqlDbType.VarChar,32), // new MySqlParameter("@Title",MySqlDbType.VarChar,32), // new MySqlParameter("@CateId",MySqlDbType.VarChar,32), // new MySqlParameter("@MarketPrice",MySqlDbType.Decimal), // new MySqlParameter("@Price",MySqlDbType.Decimal), // new MySqlParameter("@Stock",MySqlDbType.Int32), // new MySqlParameter("@PostTime",MySqlDbType.DateTime), // new MySqlParameter("@Content",MySqlDbType.Text), // }; //pars[0].Value = Product.ProductId; //pars[1].Value = Product.Title; //pars[2].Value = Product.CateId; //pars[3].Value = Product.MarketPrice; //pars[4].Value = Product.Price; //pars[5].Value = Product.Content; //pars[5].Value = Product.PostTime; //pars[7].Value = Product.Stock; return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 更新用户信息 /// </summary> /// <param name="Product"></param> /// <returns></returns> public int UpdateProduct(Product Product) { string sql = $"{ CreateSqlString.UpdateSqlString(Product) } WHERE ProductId =@ProductId"; var pars = CreateSqlString.SqlParameterArray(Product); //MySqlParameter[] pars = { // new MySqlParameter("@ProductId",MySqlDbType.VarChar,32), // new MySqlParameter("@Title",MySqlDbType.VarChar,32), // new MySqlParameter("@CateId",MySqlDbType.VarChar,32), // new MySqlParameter("@MarketPrice",MySqlDbType.Decimal), // new MySqlParameter("@Price",MySqlDbType.Decimal), // new MySqlParameter("@Stock",MySqlDbType.Int32), // new MySqlParameter("@PostTime",MySqlDbType.DateTime), // new MySqlParameter("@Content",MySqlDbType.Text), // }; //pars[0].Value = Product.ProductId; //pars[1].Value = Product.Title; //pars[2].Value = Product.CateId; //pars[3].Value = Product.MarketPrice; //pars[4].Value = Product.Price; //pars[5].Value = Product.Content; //pars[5].Value = Product.PostTime; //pars[7].Value = Product.Stock; return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 更新用户信息 /// </summary> /// <param name="Photo"></param> /// <returns></returns> public int UpdatePhoto(Photo Photo) { string sql = $"{ CreateSqlString.UpdateSqlString(Photo) } WHERE PhotoId =@PhotoId"; var pars = CreateSqlString.SqlParameterArray(Photo); return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 添加信息 /// </summary> /// <param name="AdminUser"></param> /// <returns></returns> public int AddAdminUser(AdminUser AdminUser) { string sql = CreateSqlString.InsertSqlString(AdminUser); var pars = CreateSqlString.SqlParameterArray(AdminUser); return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 更新用户信息 /// </summary> /// <param name="AdminUser"></param> /// <returns></returns> public int UpdateAdminUser(AdminUser AdminUser) { string sql = $"{ CreateSqlString.UpdateSqlString(AdminUser) } WHERE SuId =@SuId"; var pars = CreateSqlString.SqlParameterArray(AdminUser); return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 更新用户信息 /// </summary> /// <param name="Orders"></param> /// <returns></returns> public int UpdateOrders(Orders Orders) { string sql = $"{ CreateSqlString.UpdateSqlString(Orders) } WHERE OrdersId =@OrdersId"; var pars = CreateSqlString.SqlParameterArray(Orders); return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }
/// <summary> /// 更新用户信息 /// </summary> /// <param name="category"></param> /// <returns></returns> public int Updatecategory(Category category) { string sql = $"{ CreateSqlString.UpdateSqlString(category) } WHERE CateId =@CateId"; var pars = CreateSqlString.SqlParameterArray(category); //string sql = "UPDATE Category SET CateName = @CateName,ParentId = @ParentId, WHERE CateId = @CateId"; //MySqlParameter[] pars = { // new MySqlParameter("@CateName",MySqlDbType.VarChar,50), // new MySqlParameter("@ParentId",MySqlDbType.VarChar,50), // new MySqlParameter("@CateId",MySqlDbType.VarChar), // }; //pars[0].Value = category.CateName; //pars[1].Value = category.ParentId; //pars[2].Value = category.CateId; return(SqlHelper.ExecuteNonquery(sql, CommandType.Text, pars)); }