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

View File

@@ -2930,6 +2930,10 @@ namespace AyaNova.Util
//SCHEDULED USERS //SCHEDULED USERS
var actualScheduledUserCount = Fake.Random.Int(1, 2); var actualScheduledUserCount = Fake.Random.Int(1, 2);
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++) for (int a = 0; a < actualScheduledUserCount; a++)
{ {
var randomStart = Fake.Random.Int(0, 5); var randomStart = Fake.Random.Int(0, 5);
@@ -2946,95 +2950,7 @@ namespace AyaNova.Util
woItem.ScheduledUsers.Add(woItemScheduledUser); 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 //PARTS
var woItemPart = new WorkOrderItemPart() var woItemPart = new WorkOrderItemPart()