Exemplo n.º 1
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;
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        private void cmbEvents_SelectedValueChanged(object sender, EventArgs e)
        {
            int index = searchObj(objlist, cmbEvents.Text);
            eventdata obj = new eventdata();
            if (index != -1)
            {
                obj = (eventdata)objlist[index];
                //chbVeto.Checked = obj.Veto;
                //cmbPrio.Text = obj.Prio.ToString();

                ArrayList ckeckBoxList = new ArrayList();
                ArrayList comboBoxList = new ArrayList();
                foreach (var control in this.Controls)
                {
                    if (control is CheckBox)
                    {
                        ckeckBoxList.Add(((CheckBox)control));

                    }
                    else if (control is ComboBox)
                    {
                        comboBoxList.Add(((ComboBox)control));
                    }
                }

                int len = comboBoxList.Count;
                int namelen = obj.Namelist.Count;

                ComboBox cmb;
                for (int i = 0; i < len; i++)
                {
                    cmb = (ComboBox)comboBoxList[i];
                    for (int j = 0; j < namelen; j++)
                    {
                        if (cmb.Name == ("cmb" +obj.Namelist[j]))
                        {
                            cmb.Text = obj.Runslist[j].ToString();
                            break;
                        }
                        else if (cmb.Name == ("cmbPrio" + obj.Namelist[j]))
                        {
                            cmb.Text = obj.Priolist[j].ToString();
                            break;
                        }
                    }
                }
                CheckBox ckb;
                int len2 = ckeckBoxList.Count;
                for (int i = 0; i < len2; i++)
                {
                    ckb = (CheckBox)ckeckBoxList[i];
                    for (int j = 0; j < namelen; j++)
                    {
                        if (ckb.Name == ("check" + obj.Namelist[j]))
                        {
                            ckb.Checked = (bool)obj.RunAllowedlist[j];
                            break;
                        }
                        else if (ckb.Name == ("checkVeto" + obj.Namelist[j]))
                        {
                            ckb.Checked = (bool)obj.Vetolist[j];
                            break;
                        }
                    }
                }

            }
        }
Exemplo n.º 4
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();
        }