Context context = Context.Current;
try
{
string query = "update SpendApplication set dr='1' where TaskID={0}";
query = String.Format(query,context.Task.TaskID);
DataSourceManager.ExecuteNonQuery("BPMDATA", query);
query = "update Spend_ct set dr='1' where TaskID={0}";
query = String.Format(query,context.Task.TaskID);
DataSourceManager.ExecuteNonQuery("BPMDATA", query);
FlowDataTable fdt = Context.Current.FormDataSet.Tables["SpendApplication"];
foreach (FlowDataRow row in fdt.Rows)
{ string lrr=row["lrr"]==null?"":row["lrr"].ToString();
string YsDjh=row["YsDjh"]==null?"":row["YsDjh"].ToString();
Double APPlyAmount=row["APPlyAmount"]==null?0:Convert.ToDouble(row["APPlyAmount"].ToString());
Double cwfkjes=row["cwfkjes"]==null?0:Convert.ToDouble(row["cwfkjes"].ToString());
query = " update BD_OutInfo set OutAmounts=OutAmounts-{1} where YsDjh='{0}' and OutAmounts>={1}";
if(string.IsNullOrEmpty(lrr))
{
query = String.Format(query,YsDjh,APPlyAmount);
}
else
{
query = String.Format(query,YsDjh,cwfkjes);
}
DataSourceManager.ExecuteNonQuery("BPMDATA", query);
}
}
catch(Exception e)
{
throw e;
}