예제 #1
0
        private void cmbEvents_DropDown(object sender, EventArgs e)
        {
            eventdata ev = new eventdata(cmbEvents.Text);

            if ("Spring".Equals(FrmMain.SpringOrFall))
            {
                ev.setData("sep", checksep.Checked == true ? 1 : 0, checksep.Checked, checkVetosep.Checked, Int16.Parse(cmbPriosep.Text));
                ev.setData("okt", checkokt.Checked == true ? 1 : 0, checkokt.Checked, checkVetookt.Checked, Int16.Parse(cmbPriookt.Text));
                ev.setData("nov", checknov.Checked == true ? 1 : 0, checknov.Checked, checkVetonov.Checked, Int16.Parse(cmbPrionov.Text));
                ev.setData("dec", checkdec.Checked == true ? 1 : 0, checkdec.Checked, checkVetodec.Checked, Int16.Parse(cmbPriodec.Text));
                ev.setData("jan", checkjan.Checked == true ? 1 : 0, checkjan.Checked, checkVetojan.Checked, Int16.Parse(cmbPriojan.Text));
                ev.setData("feb", checkfeb.Checked == true ? 1 : 0, checkfeb.Checked, checkVetofeb.Checked, Int16.Parse(cmbPriofeb.Text));
                ev.setData("mar", checkmar.Checked == true ? 1 : 0, checkmar.Checked, checkVetomar.Checked, Int16.Parse(cmbPriomar.Text));
            }
            else if ("Fall".Equals(FrmMain.SpringOrFall))
            {
                ev.setData("mar", checkmar.Checked == true ? 1 : 0, checkmar.Checked, checkVetomar.Checked, Int16.Parse(cmbPriomar.Text));
                ev.setData("apr", checkapr.Checked == true ? 1 : 0, checkapr.Checked, checkVetoapr.Checked, Int16.Parse(cmbPrioapr.Text));
                ev.setData("maj", checkmaj.Checked == true ? 1 : 0, checkmaj.Checked, checkVetomaj.Checked, Int16.Parse(cmbPriomaj.Text));
                ev.setData("jun", checkjun.Checked == true ? 1 : 0, checkjun.Checked, checkVetojun.Checked, Int16.Parse(cmbPriojun.Text));
                ev.setData("jul", checkjul.Checked == true ? 1 : 0, checkjul.Checked, checkVetojul.Checked, Int16.Parse(cmbPriojul.Text));
                ev.setData("aug", checkaug.Checked == true ? 1 : 0, checkaug.Checked, checkVetoaug.Checked, Int16.Parse(cmbPrioaug.Text));
                ev.setData("sep", checksep.Checked == true ? 1 : 0, checksep.Checked, checkVetosep.Checked, Int16.Parse(cmbPriosep.Text));

            }

            int index = searchObj(objlist, cmbEvents.Text);
            if (index != -1)
                objlist.RemoveAt(index);

            objlist.Add(ev);
        }
예제 #2
0
        public ArrayList Loadeffectdata()
        {
            ArrayList objlist = new ArrayList();
            var effects = xDoc.Descendants("effect");

            foreach (var effect in effects)
            {
                eventdata ev = new eventdata(effect.Element("Name").Value);

                var months = effect.Descendants("Month");

                foreach (var m in months)
                {
                    ev.setData(m.Element("Name").Value, Int16.Parse(m.Element("Runs").Value), bool.Parse(m.Element("RunAllowed").Value), bool.Parse(m.Element("Veto").Value), Int16.Parse(m.Element("Prio").Value));
                }

                objlist.Add(ev);
            }

            return objlist;
        }
예제 #3
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            eventdata ev = new eventdata(cmbEvents.Text);

            if ("Spring".Equals(FrmMain.SpringOrFall))
            {
                ev.setData("sep", checksep.Checked == true ? 1 : 0, checksep.Checked, checkVetosep.Checked, Int16.Parse(cmbPriosep.Text));
                ev.setData("okt", checkokt.Checked == true ? 1 : 0, checkokt.Checked, checkVetookt.Checked, Int16.Parse(cmbPriookt.Text));
                ev.setData("nov", checknov.Checked == true ? 1 : 0, checknov.Checked, checkVetonov.Checked, Int16.Parse(cmbPrionov.Text));
                ev.setData("dec", checkdec.Checked == true ? 1 : 0, checkdec.Checked, checkVetodec.Checked, Int16.Parse(cmbPriodec.Text));
                ev.setData("jan", checkjan.Checked == true ? 1 : 0, checkjan.Checked, checkVetojan.Checked, Int16.Parse(cmbPriojan.Text));
                ev.setData("feb", checkfeb.Checked == true ? 1 : 0, checkfeb.Checked, checkVetofeb.Checked, Int16.Parse(cmbPriofeb.Text));
                ev.setData("mar", checkmar.Checked == true ? 1 : 0, checkmar.Checked, checkVetomar.Checked, Int16.Parse(cmbPriomar.Text));
            }
            else if ("Fall".Equals(FrmMain.SpringOrFall))
            {
                ev.setData("mar", checkmar.Checked == true ? 1 : 0, checkmar.Checked, checkVetomar.Checked, Int16.Parse(cmbPriomar.Text));
                ev.setData("apr", checkapr.Checked == true ? 1 : 0, checkapr.Checked, checkVetoapr.Checked, Int16.Parse(cmbPrioapr.Text));
                ev.setData("maj", checkmaj.Checked == true ? 1 : 0, checkmaj.Checked, checkVetomaj.Checked, Int16.Parse(cmbPriomaj.Text));
                ev.setData("jun", checkjun.Checked == true ? 1 : 0, checkjun.Checked, checkVetojun.Checked, Int16.Parse(cmbPriojun.Text));
                ev.setData("jul", checkjul.Checked == true ? 1 : 0, checkjul.Checked, checkVetojul.Checked, Int16.Parse(cmbPriojul.Text));
                ev.setData("aug", checkaug.Checked == true ? 1 : 0, checkaug.Checked, checkVetoaug.Checked, Int16.Parse(cmbPrioaug.Text));
                ev.setData("sep", checksep.Checked == true ? 1 : 0, checksep.Checked, checkVetosep.Checked, Int16.Parse(cmbPriosep.Text));
            }

            int index = searchObj(objlist, cmbEvents.Text);
            if (index != -1)
                objlist.RemoveAt(index);

            objlist.Add(ev);

            objlist.Sort();
            XmlHandler xml = new XmlHandler("randomeffects" + FrmMain.SpringOrFall, "Create", "eff");
            xml.createXmlFileEffecs(objlist);
            this.Close();
        }