November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
It depends on what you want to do. If you want to update the entire prices of a SKU, you can use IPriceService.SetCatalogEntryPrices(CatalogKey catalogKey, IEnumerable<IPriceValue> priceValues); The prices which are not in priceValues will be deleted.
If you want to update a specific price, or prices, then use IPriceDetailService.Save(IEnumerable<IPriceDetailValue> priceValues);
Thanks Quan..
My need is, just update the price. i did the same ( IPriceDetailService.Save(IEnumerable<IPriceDetailValue> ). But, its duplicated the one more row. not updated the price in existing Row Quan.
// Price Detail Table
var row = dataTable.NewRow();
row["ApplicationId"] = GlobalSettings.ApplicationID;
row["CatalogEntryCode"] = "P-23453";
row["MarketId"] = "DEFAULT";
row["CurrencyCode"] = "USD";
row["PriceTypeId"] = 1;
row["PriceCode"] = "Customer";
row["ValidFrom"] = DateTime.UtcNow;
row["MinQuantity"] = 0;
row["UnitPrice"] = Convert.ToDecimal(290);
dataTable.Rows.Add(row);
// catalog Entry
DataTable catalogEntryTable = new DataTable();
catalogEntryTable.Columns.Add("ApplicationId", typeof(Guid));
catalogEntryTable.Columns.Add("CatalogEntryCode", typeof(string));
var row = catalogEntryTable.NewRow();
row["ApplicationId"] = GlobalSettings.ApplicationID;
row["CatalogEntryCode"] = "P-23453";
// SP for save the price
using (SqlCommand cmd = new SqlCommand("ecf_PriceDetail_ReplacePrices", connection))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@CatalogKeys", catalogEntryTable);
cmd.Parameters.AddWithValue("@PriceValues", dataTable);
cmd.ExecuteNonQuery();
}
Above code is working fine when i set the price for first time.But , If i udpate the price second time, one more row added, instead of update the price in Existing row. Thats my problem.
Hi All,
PriceValueIds ). And save the new price entry.
Is there any way to update the price in Variant through Stored procedure? It seems, There is no Update method Explicitly. So I trying to Delete the existing Entries ( Delete(IEnumerable
But not able to delete the Existing Price Entries using Stored Procedure.
Please help me out.
Thanks in Advance.