This commit is contained in:
2022-03-02 01:19:22 +00:00
parent d5f1ac6880
commit fe162f47ca

View File

@@ -2930,111 +2930,27 @@ namespace AyaNova.Util
//SCHEDULED USERS
var actualScheduledUserCount = Fake.Random.Int(1, 2);
for (int a = 0; a < actualScheduledUserCount; a++)
{
var randomStart = Fake.Random.Int(0, 5);
var randomHours = Fake.Random.Int(1, 4);
// var randomDays = Fake.Random.Int(0, 3);
var randomStop = randomStart + randomHours;
var woItemScheduledUser = new WorkOrderItemScheduledUser()
if (isFutureDate && Fake.Random.Int(1, 10) == 2)//10% chance unscheduled future wo to show off unscheduled widget
actualScheduledUserCount=0;
for (int a = 0; a < actualScheduledUserCount; a++)
{
UserId = RandomServiceTechUserId(),
EstimatedQuantity = randomHours,
StartDate = woDate.AddHours(randomStart),//.AddDays(randomDays),
StopDate = woDate.AddHours(randomStop)//.AddDays(randomDays)
};
woItem.ScheduledUsers.Add(woItemScheduledUser);
}
var randomStart = Fake.Random.Int(0, 5);
var randomHours = Fake.Random.Int(1, 4);
// var randomDays = Fake.Random.Int(0, 3);
var randomStop = randomStart + randomHours;
var woItemScheduledUser = new WorkOrderItemScheduledUser()
{
UserId = RandomServiceTechUserId(),
EstimatedQuantity = randomHours,
StartDate = woDate.AddHours(randomStart),//.AddDays(randomDays),
StopDate = woDate.AddHours(randomStop)//.AddDays(randomDays)
};
woItem.ScheduledUsers.Add(woItemScheduledUser);
}
// {
// var randomStart = Fake.Random.Int(0, 5);
// var randomHours = Fake.Random.Int(1, 4);
// var randomDays = Fake.Random.Int(0, 3);
// var randomStop = randomStart + randomHours;
// var woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = RandomServiceTechUserId(),
// EstimatedQuantity = randomHours,
// StartDate = woDate.AddHours(randomStart).AddDays(randomDays),
// StopDate = woDate.AddHours(randomStop).AddDays(randomDays)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// }
// {
// var randomStart = Fake.Random.Int(0, 5);
// var randomHours = Fake.Random.Int(1, 4);
// var randomDays = Fake.Random.Int(0, 3);
// var randomStop = randomStart + randomHours;
// var woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = RandomServiceTechUserId(),
// EstimatedQuantity = randomHours,
// StartDate = woDate.AddHours(randomStart).AddDays(randomDays),
// StopDate = woDate.AddHours(randomStop).AddDays(randomDays)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// }
// {
// var randomStart = Fake.Random.Int(0, 5);
// var randomHours = Fake.Random.Int(1, 4);
// var randomDays = Fake.Random.Int(0, 3);
// var randomStop = randomStart + randomHours;
// var woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = RandomServiceTechUserId(),
// EstimatedQuantity = randomHours,
// StartDate = woDate.AddHours(randomStart).AddDays(randomDays),
// StopDate = woDate.AddHours(randomStop).AddDays(randomDays)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// }
// if (y == 1)
// {
// //known tech and subcontractor on every item
// var woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = KnownUserTechId,
// EstimatedQuantity = 2,
// StartDate = woDate,
// StopDate = woDate.AddHours(2)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = KnownUserSubContractorId,
// EstimatedQuantity = 2,
// StartDate = woDate,
// StopDate = woDate.AddHours(2)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// }
// if (y == 3)
// {
// //known restricted tech and subcontractor on some items
// var woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = KnownUserTechRestrictedId,
// EstimatedQuantity = 2,
// StartDate = woDate,
// StopDate = woDate.AddHours(2)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// woItemScheduledUser = new WorkOrderItemScheduledUser()
// {
// UserId = KnownUserSubContractorRestrictedId,
// EstimatedQuantity = 2,
// StartDate = woDate,
// StopDate = woDate.AddHours(2)
// };
// woItem.ScheduledUsers.Add(woItemScheduledUser);
// }
/////////////////////////////////////////
//PARTS
var woItemPart = new WorkOrderItemPart()