private static string delProv(List <string> provUpdateInput, List <ProviderModel> clinicList) { try { ProviderModel providerDel = clinicList[int.Parse(provUpdateInput[1])]; Console.WriteLine($"Deleting {providerDel.Name}? Please verify y/n"); if (Console.ReadLine().Equals("y")) { // TODO: Delete provider } } catch (Exception e) { Console.WriteLine("Error: " + e); } return(""); }
public static bool MainLogicPath(List <ProviderModel> providerAssignedList, List <ProviderModel> providerList, int lookBackDays, int day, Random rnd) { /*recieves providerAssignedList (current list of of assigned providers in order) * recieves providerList (current list of providers) * equitabilityDict (maintians providers and times assigned) * lookBackDays: the days to look back when deciding when to assign, * if lookback days = 5 and a provider is within 4 of the last spot in provider asigned List, will not assign that provider but will assign if the -6 index */ if (providerAssignedList.Count() < lookBackDays) //reassigns lookbackdays to avoid out of range exception when in early assignments of providerAssignedList { lookBackDays = providerAssignedList.Count(); } //Creates a sacrificialList, providers will be removed from this list until a suitable provider is found or until the sacrificialList is empty //If the sacrificialList is empty, break and return false //if a suitiable provider is found, add to the providerAssignedList, account for this in equitability and return true List <ProviderModel> sacrificialList = new List <ProviderModel>(providerList); while (true) { if (sacrificialList.Count() == 0) { break; } int choice = rnd.Next(0, sacrificialList.Count()); //Grab a random index from 0-the count of sacrificialList ProviderModel personChoice = sacrificialList[choice]; sacrificialList.RemoveRange(choice, 1); if (CheckDay(personChoice, day, providerAssignedList, lookBackDays)) { providerAssignedList.Add(personChoice); //Add 1 to the num assigned for the provider chosen personChoice.assignedValue++; return(false); } } return(true); }