示例#1
0
        private void PetReg_Load(object sender, EventArgs e)
        {
            metroComboBox1.Items.Clear();
            metroComboBox2.Items.Clear();

            metroComboBox2.Items.Add("Собака");
            metroComboBox2.Items.Add("Попугай");
            metroComboBox2.Items.Add("Кот");
            metroComboBox2.Items.Add("Черепаха");
            metroComboBox2.Items.Add("Волк");
            metroComboBox2.Items.Add("Кролик");

            List <persons> perl = new List <persons>();

            using (StreamReader fs = new StreamReader("bazadan.json", encoding: Encoding.Default))
            {
                string ser = fs.ReadToEnd();

                database[] newdata = JsonConvert.DeserializeObject <database[]>(ser);

                foreach (var p in newdata)
                {
                    foreach (var x in p.pers)
                    {
                        perl.Add(x);
                        Zayavka newForm = new Zayavka();
                        string  spec    = "1";

                        if (x.specialization == 0 & x.exist)
                        {
                            spec = "Клиент";
                            metroComboBox1.Items.Add(x.name);
                        }
                    }
                }
            }
        }
示例#2
0
        private void metroTile9_Click(object sender, EventArgs e)
        {
            metroComboBox4.Items.Clear();
            metroComboBox5.Items.Clear();
            metroComboBox6.Items.Clear();
            metroComboBox10.Items.Clear();
            dataGridView1.Rows.Clear();

            metroComboBox9.Items.Add(10);
            metroComboBox9.Items.Add(20);
            metroComboBox9.Items.Add(30);

            List <application> appl = new List <application>();
            List <pets>        petl = new List <pets>();
            List <persons>     perl = new List <persons>();

            using (StreamReader fs = new StreamReader("bazadan.json", encoding: Encoding.Default))
            {
                string ser = fs.ReadToEnd();

                database[] newdata = JsonConvert.DeserializeObject <database[]>(ser);

                int r = 0;

                foreach (var p in newdata)
                {
                    foreach (var x in p.pers)
                    {
                        perl.Add(x);
                        Zayavka newForm = new Zayavka();
                        string  spec    = "1";


                        if (x.specialization == 0 & x.exist)
                        {
                            spec = "Клиент";
                            metroComboBox4.Items.Add(x.name);
                            metroComboBox10.Items.Add(x.name);
                        }

                        if (x.specialization == 0)
                        {
                            foreach (var y in p.app)
                            {
                                appl.Add(y);
                                if (y.name != null)
                                {
                                    dataGridView1.Rows.Add();
                                    dataGridView1[0, r].Value = y.name;
                                    dataGridView1[1, r].Value = x.name;
                                    dataGridView1[2, r].Value = y.namepet;
                                    dataGridView1[3, r].Value = y.namevet;
                                    dataGridView1[4, r].Value = y.date;
                                    dataGridView1[5, r].Value = y.time;
                                    dataGridView1[6, r].Value = y.count;
                                    dataGridView1[7, r].Value = y.cabinet;
                                    r++;
                                }
                            }
                        }

                        if (x.specialization > 0 & x.exist)
                        {
                            metroComboBox5.Items.Add(x.name);
                        }
                    }



                    foreach (var s in p.pet)
                    {
                        petl.Add(s);

                        if (s.name == "0" | s.name == null)
                        {
                        }
                        else
                        {
                            metroComboBox6.Items.Add(s.name);
                        }
                    }
                }
            }
        }
示例#3
0
        private void metroTile2_Click(object sender, EventArgs e)
        {
            Zayavka newForm = new Zayavka();

            newForm.Show();
        }