This example uses the WCF service to delete by quote line. Obviously you’ll need to modify to loop thru your rows but I’m just using single line for test
Take a look at this thread too:
var parameters = new Ice.Core.TaskParameterInformation(this.Db, taskNum);
var quoteNum = Convert.ToInt32(parameters.GetCharacterValue("TxtParam1"));
var quoteLine = Convert.ToInt32(parameters.GetCharacterValue("TxtParam2"));
//lookup quote and iterate
using(Erp.Contracts.QuoteSvcContract quoteSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuoteSvcContract>(Db))
{
//get your quotedata
var ts = quoteSvc.GetByID(quoteNum);
if(ts.QuoteDtl!=null)
{
//loop thru toQuoteDtl find your lines you want to delete
foreach(var line in ts.QuoteDtl)
{
if(line.QuoteLine == quoteLine)
{
//mark line for delete
line.RowMod = "D";
}
}
//QuoteCoParts
foreach(var line in ts.QuoteCoPart)
{
if(line.QuoteLine == quoteLine)
{
//mark line for delete
line.RowMod = "D";
}
}
//QuoteQty
foreach(var line in ts.QuoteQty)
{
if(line.QuoteLine == quoteLine)
{
//mark line for delete
line.RowMod = "D";
}
}
//Qtmmkup
foreach(var line in ts.Qtmmkup)
{
if(line.QuoteLine == quoteLine)
{
//mark line for delete
line.RowMod = "D";
}
}
quoteSvc.Update(ref ts);
}
}