T
Thiago Przybylovicz
Good day, everyone.
I'm creating programmatically resources and assignments for resources of
type material.
When I try to insert on Project an assigment with the value of ASSN_UNITS
bigger than 10,000 (making MY_VALUE * 10,000, because the project base has
it's unit values in a scale 1:10,000), I get the SoapException
"GenaeralUnitsInvalid". The PSClientError do not help in anything.
I'm posting the code that I use too. Please, help me, it's urgent.
Code:
public void AddAssignment(Guid resGuid, Guid taskGuid, DateTime startDate,
double realWork, bool notafiscal)
{
ProjectDataSet addProjAssig = new ProjectDataSet();
ProjectDataSet.AssignmentRow newAssignment =
addProjAssig.Assignment.NewAssignmentRow();
newAssignment.ASSN_UID = Guid.NewGuid();
newAssignment.PROJ_UID = guid;
newAssignment.RES_UID = resGuid;
newAssignment.ASSN_UNITS = (realWork * 10000); //on project
10000 = 1
newAssignment.TASK_UID = taskGuid;
if (notafiscal)
{
newAssignment.ASSN_ACT_WORK = (realWork * 60000); //60000 =
1h no project;
newAssignment.ASSN_WORK = 0;
}
else
{
newAssignment.ASSN_WORK = (realWork * 60000); //60000 = 1h
on project;
newAssignment.ASSN_ACT_WORK = 0; //60000 = 1h on project;
}
newAssignment.ASSN_ACT_START = startDate;
addProjAssig.Assignment.AddAssignmentRow(newAssignment);
AddToProject(sessionGuid, addProjAssig);
}
I'm creating programmatically resources and assignments for resources of
type material.
When I try to insert on Project an assigment with the value of ASSN_UNITS
bigger than 10,000 (making MY_VALUE * 10,000, because the project base has
it's unit values in a scale 1:10,000), I get the SoapException
"GenaeralUnitsInvalid". The PSClientError do not help in anything.
I'm posting the code that I use too. Please, help me, it's urgent.
Code:
public void AddAssignment(Guid resGuid, Guid taskGuid, DateTime startDate,
double realWork, bool notafiscal)
{
ProjectDataSet addProjAssig = new ProjectDataSet();
ProjectDataSet.AssignmentRow newAssignment =
addProjAssig.Assignment.NewAssignmentRow();
newAssignment.ASSN_UID = Guid.NewGuid();
newAssignment.PROJ_UID = guid;
newAssignment.RES_UID = resGuid;
newAssignment.ASSN_UNITS = (realWork * 10000); //on project
10000 = 1
newAssignment.TASK_UID = taskGuid;
if (notafiscal)
{
newAssignment.ASSN_ACT_WORK = (realWork * 60000); //60000 =
1h no project;
newAssignment.ASSN_WORK = 0;
}
else
{
newAssignment.ASSN_WORK = (realWork * 60000); //60000 = 1h
on project;
newAssignment.ASSN_ACT_WORK = 0; //60000 = 1h on project;
}
newAssignment.ASSN_ACT_START = startDate;
addProjAssig.Assignment.AddAssignmentRow(newAssignment);
AddToProject(sessionGuid, addProjAssig);
}