/// <summary> /// 每次显示8个 /// </summary> private void showHotWord() { int start, end; if (times < tagList.Count() && times + 8 <= tagList.Count()) { start = times; end = times + 8; } else if (times < tagList.Count() - 1 && times + 8 > tagList.Count()) { start = times; end = tagList.Count() - 1; } else { start = 0; end = tagList.Count() > 8 ? 8 : tagList.Count(); } times = end; if (end - start > 0) { List <String> batch = tagList.GetRange(start, end - start); List <TagColor> colors = TagColor.getRandomColors(batch.Count()); mTagGroup.setTags(colors, batch.ToArray()); } }
public override int GetHashCode() { if (fHashCode == 0) { fHashCode = 19 * TagID + 7; fHashCode ^= 11 * EntityID + 11; fHashCode ^= 17 * EntityType + 21; if (!String.IsNullOrEmpty(TagName)) { fHashCode ^= TagName.GetHashCode(); } if (!String.IsNullOrEmpty(TagColor)) { fHashCode ^= TagColor.GetHashCode(); } if (!String.IsNullOrEmpty(TagTextColor)) { fHashCode ^= TagTextColor.GetHashCode(); } if (!String.IsNullOrEmpty(EntityName)) { fHashCode ^= EntityName.GetHashCode(); } } return(fHashCode); }
public FinancialTask(string name, TagColor color) { this.Id = Guid.NewGuid(); this.Name = name; this.Tag = new Tag(Name, color); this.Transactions = new List <Transaction>(); this.RegisterDate = DateTime.Now; }
/// <summary> /// 每次显示8个热搜词 /// </summary> private /*synchronized*/ void showHotWord() { int tagSize = 8; String[] tags = new String[tagSize]; for (int j = 0; j < tagSize && j < tagList.Count(); hotIndex++, j++) { tags[j] = tagList[hotIndex % tagList.Count()]; } List <TagColor> colors = TagColor.getRandomColors(tagSize); mTagGroup.setTags(colors, tags); }
protected override HookResult OnTaggingLogEntry(EntryInfo entry, out string tag, out TagColor tagColor) { tag = null; tagColor = TagColor.Cyan; // tag even odd row orange and change tag text. if (entry.RowNumber % 2 == 1) { tag = "Odd!"; tagColor = TagColor.Orange; return HookResult.Hooked; } return HookResult.Default; }
public static void PrintAddNewTag() { //TODO: Procedure to add a new tag to the model Console.WriteLine("You've selected the option to add tag:"); Console.WriteLine(); Console.Write("Name: "); string name = Console.ReadLine(); Console.WriteLine(); TagColor color = Display.PrintSelectTagColor(); Tag newTag = new Tag(name, color); Program.Tags.Add(newTag); Console.WriteLine("Tag added sucessfully into model. "); Console.WriteLine(); }
public void SetTagColor(TagColor tagColor) { roomColor = tagColor; if (tagColor == TagColor.One) { rend.material.color = Color.red; } else if (tagColor == TagColor.Two) { rend.material.color = Color.blue; } else { rend.material.color = Color.black; } }
public static void PrintAddNewFinancialTask() { Console.WriteLine("You've selected to add a Financialtask to your model."); Console.WriteLine("FinancialTasks can be a activity like a trip or shopping.."); Console.WriteLine(); Console.Write("Please define the Financialtask name: "); string name = Console.ReadLine(); TagColor color = PrintSelectTagColor(); Console.WriteLine(); Console.Write("Budget: "); double budget = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); FinancialTask Financialtask = new FinancialTask(name, budget, color); Program.FinancialTasks.Add(Financialtask); Program.Tags.Add(Financialtask.Tag); Console.WriteLine(); Console.WriteLine($"The Financialtask: {Financialtask}, was added sucessfully to this model!"); }
/// <summary> /// Converts one of the standard Asana colour enumerations to string format /// </summary> /// <param name="colour">The tag colour to convert</param> /// <returns>A string representation of the colour.</returns> public string TagColourToString(TagColor colour) { return(colour.ToString().Replace("_", "-")); }
public async Task WriteReadList() { // Ensure that the database starts out empty. Assert.Empty(from doc in context.Query <object>() select doc); // Verify that the generated CreateKey() methods return the // correct values. Assert.Equal($"{Person.PersistedType}::0", Person.CreateKey("0")); Assert.Equal($"{City.PersistedType}::Woodinville", City.CreateKey("Woodinville")); // Verify that we can write generated entity models. var jack = new Person() { Id = 0, Name = "Jack", Age = 10, Gender = Gender.Male, Data = new byte[] { 0, 1, 2, 3, 4 } }; var jill = new Person() { Id = 1, Name = "Jill", Age = 11, Gender = Gender.Female, Data = new byte[] { 5, 6, 7, 8, 9 } }; Assert.Equal("Test.Neon.Models.Definitions.Person::0", jack.GetKey()); Assert.Equal("Test.Neon.Models.Definitions.Person::1", jill.GetKey()); await bucket.UpsertSafeAsync(jack, persistTo : PersistTo.One); await bucket.UpsertSafeAsync(jill, persistTo : PersistTo.One); // Verify that we can read them. var jackRead = await bucket.GetSafeAsync <Person>(Person.CreateKey(0)); var jillRead = await bucket.GetSafeAsync <Person>(Person.CreateKey(1)); Assert.Equal("Test.Neon.Models.Definitions.Person::0", jackRead.GetKey()); Assert.Equal("Test.Neon.Models.Definitions.Person::1", jillRead.GetKey()); Assert.True(jack == jackRead); Assert.True(jill == jillRead); //----------------------------------------------------------------- // Persist a [City] entity (which has a different entity type) and then // perform a N1QL query to list the Person entities and verify that we // get only Jack and Jill back. This verifies the the [TypeFilter] // attribute is generated and working correctly. var city = new City() { Name = "Woodinville", Population = 12345 }; var result = await bucket.UpsertAsync(city); await bucket.WaitForIndexerAsync(); //----------------------------------------------------------------- // Query for the people and verify var peopleQuery = (from doc in context.Query <Person>() select doc); var people = peopleQuery.ToList(); Assert.Equal(2, people.Count); Assert.Contains(people, p => p.Name == "Jack"); Assert.Contains(people, p => p.Name == "Jill"); //----------------------------------------------------------------- // Query for the city and verify. var cityQuery = from doc in context.Query <City>() select doc; var cities = cityQuery.ToList(); Assert.Single(cities); Assert.Contains(cities, p => p.Name == "Woodinville"); //----------------------------------------------------------------- // Query for documents that don't exist and verify. var rawResults = await bucket.QueryAsync <object>($"select * from `{bucket.Name}` where __T=\"Test.Neon.Models.Definitions.Country\";"); var countryQuery = from doc in context.Query <Country>() select doc; Assert.Empty(rawResults.ToList()); Assert.Empty(countryQuery.ToList()); // $todo(jefflill): https://github.com/nforgeio/neonKUBE/issues/475 //----------------------------------------------------------------- // Verify that plain old object serialization still works. var poo = new PlainOldObject() { Foo = "bar" }; await bucket.UpsertSafeAsync("poo", poo, persistTo : PersistTo.One); poo = await bucket.GetSafeAsync <PlainOldObject>("poo"); Assert.Equal("bar", poo.Foo); //----------------------------------------------------------------- // Extra credit #1: Verify that [DeepClone()] works. var clone = jack.DeepClone(); Assert.Equal(jack.Name, clone.Name); Assert.Equal(jack.Age, clone.Age); Assert.Equal(jack.Gender, clone.Gender); Assert.NotSame(jack.Data, clone.Data); //----------------------------------------------------------------- // Extra credit #2: Verify that [SameTypeAs()] works. Assert.True(Person.SameTypeAs(jack)); Assert.False(Person.SameTypeAs(city)); Assert.False(Person.SameTypeAs(null)); //----------------------------------------------------------------- // Extra credit #3: Try to reproduce: // // https://github.com/nforgeio/neonKUBE/issues/738 // // I was unable to reproduce this. var color = new TagColor() { Id = "#FF0000", Name = "red" }; await bucket.UpsertSafeAsync(color, persistTo : PersistTo.One); await bucket.WaitForIndexerAsync(); var colors = from doc in context.Query <TagColor>() where doc.Id == "#FF0000" select doc; Assert.Single(colors); color = colors.First(); Assert.Equal("#FF0000", color.Id); Assert.Equal("red", color.Name); }
protected override HookResult OnTaggingLogEntry(EntryInfo entry, out string tag, out TagColor tagColor) { tag = null; tagColor = TagColor.Cyan; // tag even odd row orange and change tag text. if (entry.RowNumber % 2 == 1) { tag = "Odd!"; tagColor = TagColor.Orange; return(HookResult.Hooked); } return(HookResult.Default); }
public Tag(string name, TagColor color) { this.Name = name; this.Color = color; this.Id = Guid.NewGuid(); }
public static void Initialize(MaintenanceDbContext context) { context.Database.EnsureCreated(); //Look for any aircraft values to see if the DB successfully seeded if (context.Aircrafts.Any()) { return; // returning means DB successfully seeded } var aircraftModels = new AircraftModel[] { //new AircraftModel{ModelType="A-29", Manufacturer="Embraer", AircraftID=1}, //new AircraftModel{ModelType="C-146", Manufacturer="Fairchild Dornier", AircraftID=2}, //new AircraftModel{ModelType="C-146", Manufacturer="Fairchild Dornier", AircraftID=3}, //new AircraftModel{ModelType="A-29", Manufacturer="Embraer", AircraftID=4}, //new AircraftModel{ModelType="A-29", Manufacturer="Embraer", AircraftID=5} new AircraftModel { ModelType = "A-29", Manufacturer = "Embraer" }, new AircraftModel { ModelType = "C-146", Manufacturer = "Fairchild Dornier" } }; foreach (AircraftModel am in aircraftModels) { context.AircraftModels.Add(am); } context.SaveChanges(); var aircrafts = new Aircraft[] { new Aircraft { FaaNumber = "0011001", EasaNumber = null, TailNumber = "1234567", AircraftModelID = 1 }, new Aircraft { FaaNumber = "0011002", EasaNumber = null, TailNumber = "1234568", AircraftModelID = 1 }, new Aircraft { FaaNumber = "0011003", EasaNumber = null, TailNumber = "1234569", AircraftModelID = 1 }, new Aircraft { FaaNumber = "0011004", EasaNumber = null, TailNumber = "1234560", AircraftModelID = 2 }, new Aircraft { FaaNumber = "0011005", EasaNumber = null, TailNumber = "1234561", AircraftModelID = 2 } //new Aircraft{FaaNumber="0011001",EasaNumber=null,TailNumber="1234567"}, //new Aircraft{FaaNumber="0011002",EasaNumber=null,TailNumber="1234568"}, //new Aircraft{FaaNumber="0011003",EasaNumber=null,TailNumber="1234569"}, //new Aircraft{FaaNumber="0011004",EasaNumber=null,TailNumber="1234560"}, //new Aircraft{FaaNumber="0011005",EasaNumber=null,TailNumber="1234561"} }; foreach (Aircraft a in aircrafts) { context.Aircrafts.Add(a); } context.SaveChanges(); var locations = new Location[] { new Location { RegionCode = "DENV", RegionName = "West", LocationCode = "WWRM" }, new Location { RegionCode = "CALI", RegionName = "Pacific", LocationCode = "WWPO" }, new Location { RegionCode = "BOST", RegionName = "East", LocationCode = "ECCA" }, new Location { RegionCode = "FLAA", RegionName = "South East", LocationCode = "SESC" }, new Location { RegionCode = "TENN", RegionName = "Central", LocationCode = "CCAM" } }; foreach (Location l in locations) { context.Locations.Add(l); } context.SaveChanges(); var locationAssignments = new AircraftLocationAssignment[] { new AircraftLocationAssignment { LocationID = 1, AircraftID = 1, Planned = true, Unplanned = false }, new AircraftLocationAssignment { LocationID = 1, AircraftID = 2, Planned = true, Unplanned = false }, new AircraftLocationAssignment { LocationID = 2, AircraftID = 3, Planned = true, Unplanned = false }, new AircraftLocationAssignment { LocationID = 3, AircraftID = 4, Planned = true, Unplanned = false }, new AircraftLocationAssignment { LocationID = 4, AircraftID = 5, Planned = false, Unplanned = true } }; foreach (AircraftLocationAssignment ala in locationAssignments) { context.AircraftLocationAssignments.Add(ala); } context.SaveChanges(); var titles = new Title[] { //new Title{EmployeeID=1, TitleName="Technician"}, //new Title{EmployeeID=2, TitleName="Quality Assure"}, //new Title{EmployeeID=3, TitleName="Technician"}, //new Title{EmployeeID=4, TitleName="Government Official"}, //new Title{EmployeeID=5, TitleName="Supervisor"} new Title { TitleName = "Technician" }, new Title { TitleName = "Quality Assure" }, new Title { TitleName = "Technician" }, new Title { TitleName = "Government Official" }, new Title { TitleName = "Supervisor" } }; foreach (Title t in titles) { context.Titles.Add(t); } context.SaveChanges(); var employees = new Employee[] { new Employee { FirstName = "Bob", LastName = "Haskins", HireDate = DateTime.Parse("2018-10-01"), TitleID = 1 }, new Employee { FirstName = "Claire", LastName = "Little", HireDate = DateTime.Parse("2010-06-05"), TitleID = 2 }, new Employee { FirstName = "Tom", LastName = "Law", HireDate = DateTime.Parse("2015-12-11"), TitleID = 1 }, new Employee { FirstName = "Jason", LastName = "Day", HireDate = DateTime.Parse("2011-03-25"), TitleID = 4 }, new Employee { FirstName = "Kelly", LastName = "Wynn", HireDate = DateTime.Parse("2009-05-16"), TitleID = 5 } }; foreach (Employee e in employees) { context.Employees.Add(e); } context.SaveChanges(); // adding ATA Chapters var chapters = new AtaChapter[] { new AtaChapter { ChapterNumber = 01, ChapterSummary = "Introduction / Aircraft General" }, new AtaChapter { ChapterNumber = 02, ChapterSummary = "Operations Information" }, new AtaChapter { ChapterNumber = 03, ChapterSummary = "Periodic Inspections" }, new AtaChapter { ChapterNumber = 04, ChapterSummary = "Dimensions and Areas" }, new AtaChapter { ChapterNumber = 05, ChapterSummary = "Lifting and Shoring" }, new AtaChapter { ChapterNumber = 06, ChapterSummary = "Leveling and Weighing" }, new AtaChapter { ChapterNumber = 07, ChapterSummary = "Towing and Taxiing" }, new AtaChapter { ChapterNumber = 08, ChapterSummary = "Parking, Mooring, Storage and Return to Service" }, new AtaChapter { ChapterNumber = 09, ChapterSummary = "Placards and Markings" }, new AtaChapter { ChapterNumber = 10, ChapterSummary = "Servicing Routine Maintenance" }, new AtaChapter { ChapterNumber = 11, ChapterSummary = "Vibration and Noise Analysis (Helicopters)" } }; foreach (AtaChapter ata in chapters) { context.AtaChapters.Add(ata); } context.SaveChanges(); // adding Significant Event var events = new SignificantEvent[] { new SignificantEvent { SignificantEventDescription = "Bird Strike" }, new SignificantEvent { SignificantEventDescription = "Hard Landing" }, new SignificantEvent { SignificantEventDescription = "Flap Over Speed" }, new SignificantEvent { SignificantEventDescription = "Gear Over Speed" }, new SignificantEvent { SignificantEventDescription = "Lightning Strike" } }; foreach (SignificantEvent se in events) { context.SignificantEvents.Add(se); } context.SaveChanges(); // adding Maintenance Type var types = new MaintenanceType[] { new MaintenanceType { MaintenanceTypeDescription = "Scheduled" }, new MaintenanceType { MaintenanceTypeDescription = "Unscheduled" }, new MaintenanceType { MaintenanceTypeDescription = "Major Mod or C-Check" }, new MaintenanceType { MaintenanceTypeDescription = "Pilot Writeup" }, new MaintenanceType { MaintenanceTypeDescription = "Customer Defered" }, new MaintenanceType { MaintenanceTypeDescription = "Grounding Writeup" } }; foreach (MaintenanceType mt in types) { context.MaintenanceTypes.Add(mt); } context.SaveChanges(); // adding Reference Group Data //var references = new ReferenceGroup[] //{ // new ReferenceGroup{ReferenceDocument1="0001-90235", ReferenceDocument2="0001-90236"}, // new ReferenceGroup{ReferenceDocument1="0001-90199", ReferenceDocument2="0001-90200"}, // new ReferenceGroup{ReferenceDocument1="0001-80236", ReferenceDocument2="0001-80005"}, // new ReferenceGroup{ReferenceDocument1="0021-70067", ReferenceDocument2="0021-70068"}, // new ReferenceGroup{ReferenceDocument1="0004-90250", ReferenceDocument2="0004-90250"}, //}; //foreach(ReferenceGroup rg in references) //{ // context.ReferenceGroups.Add(rg); //} //context.SaveChanges(); var reports = new DiscrepancyReportC[] { new DiscrepancyReportC { ReportRecord = "ABVD-0000001", AircraftID = 1, EmployeeID = 1, DateDiscovered = DateTime.Parse("2018-12-01"), LocationID = 1, AtaChapterID = 1, AtaChapterEnd = "000_010", EngineStart = false, BeforeTakeoff = false, OnTakeoffRoll = false, Climb = true, Cruise = true, Descent = true, Approach = false, Landing = false, Rollout = false, Postflight = false, SignificantEventID = 1, MaintenanceTypeID = 2, MasterWarning = false, MasterCaution = true, WarningMessage1 = null, WarningMessage2 = null, AdvisoryMessage1 = null, AdvisoryMessage2 = null, WarningMessageOther = null, DiscrepancyDescription = "Bird struck the aircraft while in flight and changed the flight characteristics Aircraft must be grounded until fixed.", AoG = true, Rii = false, WorkInstructionsPlannedAction = "Check the are where the bird struck the plane.", CorrectiveActionDescription = "Found dent in a winglet from bird strike. New winglet installed and plane flight characteristics checked after fix", OpsCheckRequired = false, LeakCheck = true, TechnicianName = "Bob Haskins", TechnicianDateSigned = DateTime.Parse("2018-12-01"), QaName = "Claire Little", QaDateSigned = DateTime.Parse("2018-12-01"), GovernmentOfficial = "Steve Harmon", GovOfficialDateSigned = DateTime.Parse("2018-12-01"), ReferenceDocument1 = "100_1", ReferenceDocument2 = "100_2", CustomerName = "Jeff Ways", CustomerAcceptanceDate = DateTime.Parse("2018-12-03") }, new DiscrepancyReportC { ReportRecord = "ABVD-0000002", AircraftID = 2, EmployeeID = 3, DateDiscovered = DateTime.Parse("2018-12-03"), LocationID = 2, AtaChapterID = 2, AtaChapterEnd = "-01-115", EngineStart = true, BeforeTakeoff = true, OnTakeoffRoll = false, Climb = false, Cruise = false, Descent = false, Approach = false, Landing = false, Rollout = false, Postflight = false, SignificantEventID = 2, MaintenanceTypeID = 2, MasterCaution = false, MasterWarning = false, WarningMessage1 = "GEAR OVER SPEED", WarningMessage2 = "", AdvisoryMessage1 = "", AdvisoryMessage2 = "", WarningMessageOther = "", DiscrepancyDescription = "On landing the gear was over stressed by the pilots speed so the gear assembly" + "has to be looked at.", AoG = true, Rii = false, WorkInstructionsPlannedAction = "Check to see if anything has changed" + "during the landing and the gear over speed", CorrectiveActionDescription = "The gear was deemed opperable" + "and was cleared for flight", OpsCheckRequired = true, LeakCheck = false, TechnicianName = "Tom Law", TechnicianDateSigned = DateTime.Parse("2018-12-03"), QaName = "Claire Little", QaDateSigned = DateTime.Parse("2018-12-03"), GovernmentOfficial = null, ReferenceDocument1 = null, ReferenceDocument2 = null, CustomerName = "Jeff Ways", CustomerAcceptanceDate = DateTime.Parse("2018-12-06") }, new DiscrepancyReportC { ReportRecord = "ABVD-0000003", AircraftID = 3, EmployeeID = 1, DateDiscovered = DateTime.Parse("2018-12-05"), LocationID = 3, AtaChapterID = 3, AtaChapterEnd = "-00-012", EngineStart = false, BeforeTakeoff = false, OnTakeoffRoll = false, Climb = false, Cruise = false, Descent = false, Approach = false, Landing = false, Rollout = false, Postflight = false, SignificantEventID = 3, MaintenanceTypeID = 1, MasterCaution = false, MasterWarning = false, WarningMessage1 = "", WarningMessage2 = "", AdvisoryMessage1 = "", AdvisoryMessage2 = "", WarningMessageOther = "", DiscrepancyDescription = "Routine oil change on the aircraft", AoG = true, Rii = false, WorkInstructionsPlannedAction = "The oil on the plane needed to be changed after 10,000 flight hours", CorrectiveActionDescription = "Change oil and check engine for proper function", OpsCheckRequired = false, LeakCheck = true, TechnicianName = "Bob Haskins", TechnicianDateSigned = DateTime.Parse("2018-12-05"), QaName = "Claire Little", QaDateSigned = DateTime.Parse("2018-12-05"), GovernmentOfficial = null, ReferenceDocument1 = "11-0005", ReferenceDocument2 = null, CustomerName = "Jeff Ways", CustomerAcceptanceDate = DateTime.Parse("2018-12-08") }, new DiscrepancyReportC { ReportRecord = "ABVD-0000004", AircraftID = 4, EmployeeID = 3, DateDiscovered = DateTime.Parse("2018-12-08"), LocationID = 4, AtaChapterID = 5, AtaChapterEnd = "-00-300", EngineStart = false, BeforeTakeoff = false, OnTakeoffRoll = false, Climb = false, Cruise = false, Descent = false, Approach = false, Landing = false, Rollout = false, Postflight = false, SignificantEventID = 3, MaintenanceTypeID = 1, MasterCaution = false, MasterWarning = false, WarningMessage1 = "", WarningMessage2 = "", AdvisoryMessage1 = "", AdvisoryMessage2 = "", WarningMessageOther = "", DiscrepancyDescription = "Placards are falling off must be replaced", AoG = true, Rii = false, WorkInstructionsPlannedAction = "Fix the placards and make sure connection is tight", CorrectiveActionDescription = "Placards fixed and secured tightly", OpsCheckRequired = false, LeakCheck = true, TechnicianName = "Tom Law", TechnicianDateSigned = DateTime.Parse("2018-12-08"), QaName = "Claire Little", QaDateSigned = DateTime.Parse("2018-12-08"), GovernmentOfficial = null, ReferenceDocument1 = null, ReferenceDocument2 = null, CustomerName = "Jeff Ways", CustomerAcceptanceDate = DateTime.Parse("2018-12-08") }, new DiscrepancyReportC { ReportRecord = "ABVD-0000005", AircraftID = 5, EmployeeID = 1, DateDiscovered = DateTime.Parse("2018-12-09"), LocationID = 5, AtaChapterID = 7, AtaChapterEnd = "-00-301", EngineStart = false, BeforeTakeoff = false, OnTakeoffRoll = false, Climb = false, Cruise = false, Descent = false, Approach = false, Landing = false, Rollout = false, Postflight = false, SignificantEventID = 5, MaintenanceTypeID = 1, MasterCaution = false, MasterWarning = false, WarningMessage1 = "", WarningMessage2 = "", AdvisoryMessage1 = "", AdvisoryMessage2 = "", WarningMessageOther = "", DiscrepancyDescription = "Aircraft is undergoing a full inspection. This is a scheduled event.", AoG = true, Rii = false, WorkInstructionsPlannedAction = "The aircraft and it's system will undergo full system inspection", CorrectiveActionDescription = "Aircraft inspected and deemed flight worthy. Everything operational", OpsCheckRequired = true, LeakCheck = true, TechnicianName = "Bob Haskins", TechnicianDateSigned = DateTime.Parse("2018-12-09"), QaName = "Claire Little", QaDateSigned = DateTime.Parse("2018-12-09"), GovernmentOfficial = null, ReferenceDocument1 = null, ReferenceDocument2 = null, CustomerName = "Jeff Ways", CustomerAcceptanceDate = DateTime.Parse("2018-12-11") } }; foreach (DiscrepancyReportC dr in reports) { context.DiscrepancyReportCs.Add(dr); } context.SaveChanges(); // seeding the removal installation form data var forms = new RemovalInstallationForm[] { new RemovalInstallationForm { DiscrepancyReportCID = 1, DateFormCreated = DateTime.Parse("2018-12-01"), EmployeeID = 1, RemovedPartNumber1 = "PN1234", RemovedPartSerialNumber1 = "SN1234", NomenclaturePart1 = "Nom1", RemovedPartNumber2 = "PN1235", RemovedPartSerialNumber2 = "SN1235", NomenclaturePart2 = "Nom2", RemovedPartNumber3 = null, RemovedPartSerialNumber3 = null, NomenclaturePart3 = null, RemovedPartNumber4 = null, RemovedPartSerialNumber4 = null, NomenclaturePart4 = null, InstalledPartNumber1 = "PN0987", InstalledPartSerialNumber1 = "SN0987", InstalledPartNumber2 = "SN0986", InstalledPartSerialNumber2 = "SN0986", InstalledPartNumber3 = null, InstalledPartSerialNumber3 = null, InstalledPartNumber4 = null, InstalledPartSerialNumber4 = null, CorrectedBy = "Bob Haskins", DateCorrected = DateTime.Parse("2018-12-01"), InspectedBy = null, DateInspected = null, FiledBy = null, DateFiled = null }, new RemovalInstallationForm { DiscrepancyReportCID = 2, DateFormCreated = DateTime.Parse("2018-12-03"), EmployeeID = 3, RemovedPartNumber1 = "PN1123", RemovedPartSerialNumber1 = "SN1123", NomenclaturePart1 = "Nom1", RemovedPartNumber2 = "PN1135", RemovedPartSerialNumber2 = "SN1135", NomenclaturePart2 = "Nom2", RemovedPartNumber3 = "PN1126", RemovedPartSerialNumber3 = "SN1126", NomenclaturePart3 = "Nom3", RemovedPartNumber4 = null, RemovedPartSerialNumber4 = null, NomenclaturePart4 = null, InstalledPartNumber1 = "PN1987", InstalledPartSerialNumber1 = "SN1987", InstalledPartNumber2 = null, InstalledPartSerialNumber2 = null, InstalledPartNumber3 = null, InstalledPartSerialNumber3 = null, InstalledPartNumber4 = null, InstalledPartSerialNumber4 = null, CorrectedBy = "Tom Law", DateCorrected = DateTime.Parse("2018-12-03"), InspectedBy = "Claire Little", DateInspected = DateTime.Parse("2018-12-03"), FiledBy = null, DateFiled = null }, new RemovalInstallationForm { DiscrepancyReportCID = 3, DateFormCreated = DateTime.Parse("2018-12-05"), EmployeeID = 1, RemovedPartNumber1 = "PN1114", RemovedPartSerialNumber1 = "SN1114", NomenclaturePart1 = "Nom1", RemovedPartNumber2 = "PN1115", RemovedPartSerialNumber2 = "SN1115", NomenclaturePart2 = "Nom2", RemovedPartNumber3 = null, RemovedPartSerialNumber3 = null, NomenclaturePart3 = null, RemovedPartNumber4 = null, RemovedPartSerialNumber4 = null, NomenclaturePart4 = null, InstalledPartNumber1 = "PN0987", InstalledPartSerialNumber1 = "SN0987", InstalledPartNumber2 = "SN2986", InstalledPartSerialNumber2 = "SN2986", InstalledPartNumber3 = "PN2987", InstalledPartSerialNumber3 = "SN2987", InstalledPartNumber4 = "PN2988", InstalledPartSerialNumber4 = "SN2988", CorrectedBy = "Bob Haskins", DateCorrected = DateTime.Parse("2018-12-05"), InspectedBy = "Claire Little", DateInspected = DateTime.Parse("2018-12-05"), FiledBy = "Sarah Homes", DateFiled = DateTime.Parse("2018-12-05") }, new RemovalInstallationForm { DiscrepancyReportCID = 4, DateFormCreated = DateTime.Parse("2018-12-08"), EmployeeID = 3, RemovedPartNumber1 = "PN1111", RemovedPartSerialNumber1 = "SN1111", NomenclaturePart1 = "Nom1", RemovedPartNumber2 = "PN1112", RemovedPartSerialNumber2 = "SN1112", NomenclaturePart2 = "Nom2", RemovedPartNumber3 = null, RemovedPartSerialNumber3 = null, NomenclaturePart3 = null, RemovedPartNumber4 = null, RemovedPartSerialNumber4 = null, NomenclaturePart4 = null, InstalledPartNumber1 = "PN0984", InstalledPartSerialNumber1 = "SN0984", InstalledPartNumber2 = "SN0983", InstalledPartSerialNumber2 = "SN0983", InstalledPartNumber3 = null, InstalledPartSerialNumber3 = null, InstalledPartNumber4 = null, InstalledPartSerialNumber4 = null, CorrectedBy = "Tom Law", DateCorrected = DateTime.Parse("2018-12-08"), InspectedBy = null, DateInspected = null, FiledBy = null, DateFiled = null }, new RemovalInstallationForm { DiscrepancyReportCID = 1, DateFormCreated = DateTime.Parse("2018-12-09"), EmployeeID = 1, RemovedPartNumber1 = "PN1234", RemovedPartSerialNumber1 = "SN1234", NomenclaturePart1 = "Nom1", RemovedPartNumber2 = "PN1222", RemovedPartSerialNumber2 = "SN1222", NomenclaturePart2 = "Nom2", RemovedPartNumber3 = null, RemovedPartSerialNumber3 = null, NomenclaturePart3 = null, RemovedPartNumber4 = null, RemovedPartSerialNumber4 = null, NomenclaturePart4 = null, InstalledPartNumber1 = "PN0087", InstalledPartSerialNumber1 = "SN0087", InstalledPartNumber2 = "SN0086", InstalledPartSerialNumber2 = "SN0086", InstalledPartNumber3 = null, InstalledPartSerialNumber3 = null, InstalledPartNumber4 = null, InstalledPartSerialNumber4 = null, CorrectedBy = "Bob Haskins", DateCorrected = DateTime.Parse("2018-12-09"), InspectedBy = null, DateInspected = null, FiledBy = null, DateFiled = null } }; foreach (RemovalInstallationForm rif in forms) { context.RemovalInstallationForms.Add(rif); } context.SaveChanges(); // seeding the order status data var statuses = new OrderStatus[] { new OrderStatus { StatusDescription = "New" }, new OrderStatus { StatusDescription = "Processing" }, new OrderStatus { StatusDescription = "Closed/Shipped" }, new OrderStatus { StatusDescription = "Dead" }, new OrderStatus { StatusDescription = "Drop Shipped" } }; foreach (OrderStatus os in statuses) { context.OrderStatuses.Add(os); } context.SaveChangesAsync(); // seeding tag color data var colors = new TagColor[] { new TagColor { ColorOfTag = "Green" }, new TagColor { ColorOfTag = "Red" }, new TagColor { ColorOfTag = "Yellow" }, new TagColor { ColorOfTag = "Blue" }, new TagColor { ColorOfTag = "Orange" } }; foreach (TagColor tg in colors) { context.TagColors.Add(tg); } context.SaveChangesAsync(); // seeding Category data var categories = new PartCategory[] { new PartCategory { CategoryName = "Wings" }, new PartCategory { CategoryName = "Engines" }, new PartCategory { CategoryName = "Landing Gear" }, new PartCategory { CategoryName = "Fuselage" }, new PartCategory { CategoryName = "Cargo Bay" } }; foreach (PartCategory pc in categories) { context.PartCategories.Add(pc); } context.SaveChangesAsync(); // seeding Subcategory data var subcategories = new PartSubCategory[] { new PartSubCategory { SubCategoryName = "Boeing" }, new PartSubCategory { SubCategoryName = "GE" }, new PartSubCategory { SubCategoryName = "AeroShell" }, new PartSubCategory { SubCategoryName = "Dunlop Aviation" }, new PartSubCategory { SubCategoryName = "HB Fuller" }, new PartSubCategory { SubCategoryName = "L3" }, new PartSubCategory { SubCategoryName = "Rieker Instruments" }, new PartSubCategory { SubCategoryName = "UTC Aerospace Systems" } }; foreach (PartSubCategory psc in subcategories) { context.PartSubCategories.Add(psc); } context.SaveChangesAsync(); // seeding the NEW Order Form Data var orders = new NewOrderForm[] { new NewOrderForm { DateOrderCreated = DateTime.Parse("2018-12-01"), Edd = DateTime.Parse("2018-12-15"), EmployeeID = employees.Single(e => e.FirstName == "Bob").ID, OrderNumber = "XVY-1234", OrderStatusID = statuses.Single(s => s.StatusDescription == "New").ID, PartCategoryID = categories.Single(c => c.CategoryName == "Wings").ID, PartDocumentNumber = "AV-0101", PartName = "Winglet", PartQuantity = 1, PartSubCategoryID = subcategories.Single(ps => ps.SubCategoryName == "Boeing").ID, TrackingNumber = "AB1452-HJB0098", Ui = "Nom" } }; foreach (NewOrderForm o in orders) { context.NewOrderForms.Add(o); } context.SaveChangesAsync(); }
public static Color ToMediaColor(this TagColor c, byte alpha) { return(Color.FromArgb(alpha, c.R, c.G, c.B)); }
public static Color ToMediaColor(this TagColor c) { return(Color.FromArgb(c.A, c.R, c.G, c.B)); }