Dear All ,
Can any one correct this below mentioned code?
It is checking one job material but not checking multiple job materials.
foreach (var LaborDtl_iterator in (from LaborDtl_Row in ttLaborDtl
where (string.Equals(LaborDtl_Row.RowMod, IceRow.ROWSTATE_ADDED, StringComparison.OrdinalIgnoreCase)) || (string.Equals(LaborDtl_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase))
select LaborDtl_Row))
{
var V_LaborDtl = LaborDtl_iterator;
Company = V_LaborDtl.Company;
LQty = V_LaborDtl.LaborQty;
// this.PublishInfoMessage("LQty"+LQty, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
foreach (var LaborDtl1_iterator in (from LaborDtl_Row in Db.LaborDtl
where LaborDtl_Row.Company == V_LaborDtl.Company && (LaborDtl_Row.JobNum == V_LaborDtl.JobNum )
&& LaborDtl_Row.LaborDtlSeq != V_LaborDtl.LaborDtlSeq
select LaborDtl_Row))
{
LaborDtl1 = LaborDtl1_iterator;
PLQty = PLQty+LaborDtl1.LaborQty;
LS = LaborDtl1.LaborDtlSeq;
}
OCQty = LQty+PLQty;
//this.PublishInfoMessage("OCQty"+OCQty, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
JobHead = (from JobHead_Row in Db.JobHead where string.Compare(JobHead_Row.Company,Company, true) == 0
&& JobHead_Row.JobNum == V_LaborDtl.JobNum
select JobHead_Row).FirstOrDefault();
if (JobHead != null)
{
ProdQty = JobHead.ProdQty;
// LabASQty = PerQty*LQty;
foreach (var JobMtl_iterator in (from JobMtl_Row in Db.JobMtl
where JobMtl_Row.Company == JobHead.Company && (JobMtl_Row.JobNum == V_LaborDtl.JobNum )
select JobMtl_Row))
{
JobMtl = JobMtl_iterator;
PerQty = JobMtl.QtyPer;
ReqQty = JobMtl.RequiredQty;
IssueQty = JobMtl.IssuedQty;
LabASQty = PerQty*OCQty;
MtlSeq = JobMtl.MtlSeq;
POSTQ = JobMtl.POST_c;
NEGQ = JobMtl.NEGT_c;
FixedQty = JobMtl.FixedQty;
//this.PublishInfoMessage("Plese ensure to issue the all material of Job."+"MTLSq+m"+MtlSeq+"LQ"+LabASQty+"IQ"+IssueQty, Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "", "");
if ( POSTQ == 0 )
{
if ( NEGQ == 0 )
{
if ( FixedQty = true )
{
LabASQty22 = (IssueQty * ProdQty );
FFQty = LabASQty22/PerQty;
}
if(LabASQty > FFQty )
{
object THROW_PRIVATE = null;
//CallContext.Current.ExceptionManager.AddBLException("JobQty"+PerQty+"LQty"+OCQty+"iss"+IssueQty+"LabASQty"+LabASQty);
CallContext.Current.ExceptionManager.AddBLException("PLease wait , Fixed qty is detected. Labour qty should be equal to " + LabASQty22 + ReqQty +FFQty );
THROW_PRIVATE = null;
break;
}
}
}
}
}