public void Set(List <CheckInfo> gen, List <CheckInfo> chk) { General = gen; Check = chk; TbContestName.Text = General.GetByName("ContestName"); CbCategory.Items.Clear(); var sects = Sectors.ToArray(General.GetByName("Sectors")).ToList(); foreach (var cat in sects) { if (cat != null) { CbCategory.Items.Add("(" + cat.Code + ")" + cat.WrittenName); } } CbCategory.IsEnabled = CbCategory.Items.Count > 0 ? true : false; WpPower.Children.Clear(); var pows = PowerMode.ToArray(General.GetByName("PowerMode")).ToList(); foreach (var mod in pows) { WpPower.Children.Add(new RadioButton() { Content = mod.Name, GroupName = "PowerMode" }); } TbCoeff.IsEnabled = chk.GetByName("CoeffSetting").ToBool(); TbMainContestNo.IsEnabled = chk.GetByName("AreaNoExists").ToBool(); TbSubContestNo.IsEnabled = !chk.GetByName("AreaByFreq").IsEmpty(); }
public EditSectors(CheckInfo src) { Result = null; tmp = src; InitializeComponent(); sectorData = new ObservableCollection <Sectors>(Sectors.ToArray(src.Data)); DgSectors.ItemsSource = sectorData; sectorData.CollectionChanged += SectorData_CollectionChanged; }
private string MakeSummery(CheckData check) { string log = "<SUMMARYSHEET VERSION=R2.0>\r\n"; try { if (check.Gens.GetByName("ContestName").IsEmpty()) { return(null); } log += "<CONTESTNAME>" + check.Gens.GetByName("ContestName") + "</CONTESTNAME>\r\n"; log += "<CATEGORYCODE>"; var catidx = ConfigGeneral.GetCategoryIndex(check.ConGen.Category, check.Gens); if (catidx != -1) { log += Sectors.ToArray(check.Gens.GetByName("Sectors")).ToArray()[catidx].Code; } else { return(null); } if (check.ConGen.PowerModeArg != -1) { log += PowerMode.ToArray(check.Gens.GetByName("PowerMode"))[check.ConGen.PowerModeArg].SuffixPowerSign; } log += "</CATEGORYCODE>\r\n"; log += "<CALLSIGN>" + check.ConSol.CallSign + "</CALLSIGN>\r\n"; if (check.ConSol.GestOp != "") { log += "<OPCALLSIGN>" + check.ConSol.GestOp + "</OPCALLSIGN>\r\n"; } log += "<TOTALSCORE>" + SumPoint + "</TOTALSCORE>\r\n"; log += "<ADDRESS>" + check.ConSol.Address + "</ADDRESS>\r\n"; log += "<NAME>" + check.ConSol.Name + "</NAME>\r\n"; log += "<TEL>" + check.ConSol.PhoneNumber + "</TEL>\r\n"; log += "<EMAIL>" + check.ConSol.MailAddress + "</EMAIL>\r\n"; log += "<POWER>" + check.ConGen.PowerValue + "</POWER>\r\n"; if (check.Ches.GetByName("CoeffSetting").ToBool()) { log += "<FDCOEFF>" + check.ConGen.Coeff + "</FDCOEFF>\r\n"; } log += "<OPPLACE>" + check.ConSol.Place + "</OPPLACE>\r\n"; log += "<POWERSUPPLY>" + check.ConSol.Supply + "</POWERSUPPLY>\r\n"; log += "<COMMENTS>" + check.ConSol.Comment + "</COMMENTS>\r\n"; if (check.ConGen.AutoOperator) { log += "<MULTIOPLIST>" + string.Join(",", check.Logs.Select(x => x.Operator).Distinct()) + "</MULTIOPLIST>\r\n"; } else { log += "<MULTIOPLIST>" + check.ConGen.Operators + "</MULTIOPLIST>\r\n"; } log += "<OATH>" + check.ConSol.Oath + "</OATH>\r\n"; log += "<DATE>" + System.DateTime.Now.ToLocalTime().ToString("yyyy年MM月dd日") + "</DATE>\r\n"; log += "<SIGNATURE>" + check.ConSol.LicenserName + "</SIGNATURE>\r\n"; } catch { return(null); } log += "</SUMMARYSHEET>\r\n"; return(log); }