Hi all
I'm not sure if it's a lack of sleep coffee or something but i seem to be missing something with in some code. Basically i'm trying to build a price list by coping another but while it's coping i want it to check the productid and if it matches i want it to put in a certain price. Can some kind person have a little gander of the code below and point out my simple mistake
for (int index = 0; productPriceLevelList.Entities != null && index < productPriceLevelList.Entities.Count; index++)
{
Entity newProductPriceLevelEntity = new Entity("productpricelevel");
newProductPriceLevelEntity["pricelevelid"] = new EntityReference("pricelevel", newPriceLevelId);
//string productidtext = productPriceLevelList.Entities["Product","productid"];
newProductPriceLevelEntity["productid"] = productPriceLevelList.Entities[index]["productid"];
string Price3000 = ManholePrice3000.Get<string>(executionContext);
newProductPriceLevelEntity["uomid"] = productPriceLevelList.Entities[index]["uomid"];
string prodidse = newProductPriceLevelEntity["productid"];
//prodidcon = Convert.ToString(productidtext);
if (prodidse == r1)
{
costamount = 1000;
goto endt;
}
else if (prodidse == "R1050750N")
{
costamount = 2000;
goto endt;
}
else
{
costamount = 99;
;
}
endt:
newProductPriceLevelEntity["amount"] = new Money(costamount);
service.Create(newProductPriceLevelEntity);
}
Many Thanks
Dan