Esempio n. 1
0
        public void SetGeneral(ConfigGeneral gen)
        {
            if (gen.ContestName == General?.GetByName("ContestName"))
            {
                TbContestName.Text = gen.ContestName;
                var catidx = ConfigGeneral.GetCategoryIndex(gen.Category, General);
                if (catidx != -1)
                {
                    CbCategory.SelectedIndex = catidx;
                }

                if (gen.PowerModeArg < WpPower.Children.Count && 0 <= gen.PowerModeArg)
                {
                    (WpPower.Children[gen.PowerModeArg] as RadioButton).IsChecked = true;
                }
                else
                {
                    for (int i = 0; i < WpPower.Children.Count; i++)
                    {
                        (WpPower.Children[i] as RadioButton).IsChecked = false;
                    }
                }

                if (0 <= gen.Coeff)
                {
                    TbCoeff.Text = gen.Coeff.ToString();
                }
                TbMainContestNo.Text = gen.MainCn;
                TbSubContestNo.Text  = gen.SubCn;
                CbPowerValue.Text    = gen.PowerValue.ToString();

                CbAutoOperator.IsChecked = gen.AutoOperator;
                TbOperator.Text          = gen.Operators;
            }
        }
Esempio n. 2
0
        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);
        }