//todo public bool DeleteOne(CandidateClearanceVm viewModel, ref string msg) { if (!EntryChecker.IsNotZeroOrNull(viewModel.PositionId.GetInt(), ref msg)) { return(false); } return(db.DeleteOne(MapProperties(viewModel), ref msg)); }
public bool EditOne(CampaignGroupVm viewModel, ref string msg) { if (!EntryChecker.IsNotNullOrNotWhiteSpace(viewModel.Title, ref msg)) { return(false); } return(db.EditOne(MapProperties(viewModel), ref msg)); }
public bool DeleteOne(CampaignGroupVm viewModel, ref string msg) { if (!EntryChecker.IsNotZeroOrNull(viewModel.Id.GetInt(), ref msg)) { return(false); } return(db.DeleteOne(MapProperties(viewModel), ref msg)); }
public bool AddOne(StudentVm viewModel, ref string msg) { if (!EntryChecker.IsNotNullOrNotWhiteSpace(viewModel.Title, ref msg)) { return(false); } return(db.AddOne(MapProperties(viewModel), ref msg)); }
public bool EditOne(VoterClearanceVm viewModel, ref string msg) { if (!EntryChecker.IsNotZeroOrNull(viewModel.Id.GetInt(), viewModel.GradeId.GetInt(), viewModel.PositionId.GetInt(), ref msg)) { return(false); } return(db.EditOne(MapProperties(viewModel), ref msg)); }
public bool AddOne(PositionVm viewModel, ref string msg, ref int newId) { if (!EntryChecker.IsNotNullOrNotWhiteSpace(viewModel.Title, ref msg)) { return(false); } return(db.AddOne(MapProperties(viewModel), ref msg, ref newId)); }
public bool AddOne(GradeAndSectionVm viewModel, ref string msg) { if (!EntryChecker.IsNotNullOrNotWhiteSpace(viewModel.Title, ref msg) && !EntryChecker.IsNotZeroOrNull(viewModel.GradeId.GetInt(), viewModel.SectionId.GetInt(), ref msg)) { return(false); } return(db.AddOne(MapProperties(viewModel), ref msg)); }
private void SaveGameData() { if (EntryChecker.CheckIfStartAndEndPointAreNotTheSame()) { CustomEvents.showWarningDialogEvent.Invoke("Start and End point can't be the same!"); } else { CustomEvents.setGameDataEvent.Invoke(); CustomEvents.showOptionsPopupEvent.Invoke(false); } }
public static void TestPropertiesInBinaryAssets() { var dlcModPath = @"C:\Users\mgame\source\repos\ME2Randomizer\ME2Randomizer\staticfiles\binary"; ReferenceCheckPackage rcp = new ReferenceCheckPackage(); bool checkCanceled = false; EntryChecker.CheckReferences(rcp, dlcModPath, EntryChecker.NonLocalizedStringConverter, x => Debug.WriteLine(x)); var cookedPC = ME2Directory.CookedPCPath; var sourcePackages = Directory.GetFiles(cookedPC, "SFX*.pcc", SearchOption.TopDirectoryOnly).Select(x => MEPackageHandler.OpenMEPackage(x)).ToList(); sourcePackages.AddRange(Directory.GetFiles(cookedPC, "Bio*.pcc", SearchOption.TopDirectoryOnly).Select(x => MEPackageHandler.OpenMEPackage(x))); foreach (var s in rcp.GetInfoWarnings()) { Debug.WriteLine($"INFO: {s.Message}"); } foreach (var s in rcp.GetSignificantIssues()) { Debug.WriteLine($"SIGNIFICANT: {s.Message}"); if (s.Entry is ExportEntry exp) { ExportEntry sourceToPull = null; foreach (var sp in sourcePackages) { sourceToPull = sp.FindExport(exp.InstancedFullPath); if (sourceToPull != null) { break; } } if (sourceToPull != null) { EntryImporter.ImportAndRelinkEntries(EntryImporter.PortingOption.ReplaceSingular, sourceToPull, exp.FileRef, exp, true, out _); Debug.WriteLine(" > REPLACED"); } } } foreach (var s in rcp.GetBlockingErrors()) { Debug.WriteLine($"BLOCKING: {s.Message}"); } var packagesToSave = rcp.GetSignificantIssues().Where(x => x.Entry != null && x.Entry.FileRef.IsModified).Select(x => x.Entry.FileRef).Distinct().ToList(); foreach (var p in packagesToSave) { p.Save(); } }
public static void TestPropertiesInMERFS() { var dlcModPath = Path.Combine(MEDirectories.GetDefaultGamePath(MERFileSystem.Game), "BioGame", "DLC", $"DLC_MOD_{MERFileSystem.Game}Randomizer", "CookedPC"); ReferenceCheckPackage rcp = new ReferenceCheckPackage(); bool checkCanceled = false; EntryChecker.CheckReferences(rcp, dlcModPath, EntryChecker.NonLocalizedStringConverter, x => Debug.WriteLine(x)); foreach (var s in rcp.GetInfoWarnings()) { Debug.WriteLine($"INFO: {s}"); } foreach (var s in rcp.GetSignificantIssues()) { Debug.WriteLine($"SIGNIFICANT: {s}"); } foreach (var s in rcp.GetBlockingErrors()) { Debug.WriteLine($"BLOCKING: {s}"); } }