D
Daniel Wilson
LaborPool *Simulator::Controller::GetLaborPool(int LaborPoolID){
if (LaborPools->ContainsKey(__box(LaborPoolID))){
return dynamic_cast<LaborPool *>(LaborPools->Item[__box(LaborPoolID)]);
} else {
try {
LaborPool *newLP = new LaborPool(UltimateParent, DbConn, LaborPoolID);
LaborPools->Add(__box(newLP->ID), newLP);
return newLP;
} catch (Exception *Ex) {
throw Ex;
}
}
}
When LaborPoolID == 70,
LaborPools->ContainsKey(__box(LaborPoolID)) evaluates to false;
But LaborPools->Add(__box(newLP->ID), newLP) throws an exception,
"Item has already been added. Key in dictionary: "70" Key being added:
"70"".
What are we doing wrong?
Thanks.
dwilson
if (LaborPools->ContainsKey(__box(LaborPoolID))){
return dynamic_cast<LaborPool *>(LaborPools->Item[__box(LaborPoolID)]);
} else {
try {
LaborPool *newLP = new LaborPool(UltimateParent, DbConn, LaborPoolID);
LaborPools->Add(__box(newLP->ID), newLP);
return newLP;
} catch (Exception *Ex) {
throw Ex;
}
}
}
When LaborPoolID == 70,
LaborPools->ContainsKey(__box(LaborPoolID)) evaluates to false;
But LaborPools->Add(__box(newLP->ID), newLP) throws an exception,
"Item has already been added. Key in dictionary: "70" Key being added:
"70"".
What are we doing wrong?
Thanks.
dwilson