示例#1
0
        public void Out(string way, CreateList p)
        {
            FileStream    file     = new FileStream(way, FileMode.Create);
            XmlSerializer fileName = new XmlSerializer(typeof(CreateList));

            fileName.Serialize(file, p);
            file.Close();
        }
示例#2
0
        public CreateList In(string way, CreateList p)
        {
            FileStream    file1     = new FileStream(way, FileMode.Open);
            XmlSerializer filename1 = new XmlSerializer(typeof(CreateList));

            p = (CreateList)filename1.Deserialize(file1);
            file1.Close();
            return(p);
        }
示例#3
0
 private void LogInForm_Load(object sender, EventArgs e)
 {
     if (ButReg.Visible == true)
     {
         back.Visible = false;
     }
     else
     {
         back.Visible = true;
     }
     WrName.Hide();
     WrPass.Hide();
     Enter.Hide();
     Enter1.Hide();
     Reges.Hide();
     Reges1.Hide();
     Okenter.Hide();
     Okreg.Hide();
     MyList = Seria.In("1.xml", MyList);
 }
示例#4
0
        private void Main_Load(object sender, EventArgs e)
        {
            panel2.Hide();
            List = Seria.In(@"1.xml", List);
            //FileStream file1 = new FileStream(@"3.xml", FileMode.Create);
            //XmlSerializer fileName1 = new XmlSerializer(typeof(List<Massive>));
            //fileName1.Serialize(file1, p.Mass);
            //file1.Close();
            //Seria.Out(@"3.xml", DataBase.Mass);
            DataBase.Mass = Seria.In(@"3.xml", DataBase.Mass);
            panel1.Hide();
            KorzinaLabel.Hide();
            IElLabel.Hide();
            Counter.Hide();
            Delete.Hide();
            button3.Hide();
            dateTimePicker1.Hide();
            numericUpDown1.Hide();
            label3.Hide();
            int x2   = 10;
            int y2   = 20;
            int x3   = 200;
            int y3   = y2;
            int q    = 0;
            int sum1 = 0;
            int sum2 = 0;
            int i    = 0;

            foreach (var item in DataBase.Mass)
            {
                CountryBox.Items.Add("");
                CountryBox.Items[i] = item.Country;
                i++;
            }

            Korzina = Seria.In(@"2.xml", Korzina);
            int q1 = Korzina.Cost.Count();
            int q3 = q1 * 2;
            int q4 = Korzina.CostCur.Count() + q1 * 2;
            int q2 = Korzina.Cost.Count() * 2 + Korzina.CostCur.Count() * 2;

            Counter.Minimum        = 1;
            numericUpDown1.Minimum = 1;
            for (int asd = 0; asd < Korzina.Index.Count; asd++)
            {
                if (Korzina.Index[asd] == IndexName)
                {
                    sum2++;
                }
            }
            Counter.Maximum        = sum2;
            numericUpDown1.Maximum = sum2;

            for (int j = 0; j < Korzina.Hotel.Count(); j++, q++, q1++)
            {
                if (IndexName == Korzina.Index[j])
                {
                    label[q]           = new Label();
                    label[q].AutoSize  = true;
                    label[q].Text      = Korzina.Hotel[j];
                    label[q].Location  = new Point(x2, y2);
                    label[q1]          = new Label();
                    label[q1].AutoSize = true;
                    label[q1].Text     = Convert.ToString(Korzina.Cost[j]) + " $";
                    label[q1].Location = new Point(x3, y3);

                    sum1 += Korzina.Cost[j];


                    panel1.Controls.Add(label[q]);
                    panel1.Controls.Add(label[q1]);

                    y2 += 60;
                    y3 += 60;
                }
            }
            int x6 = x2;
            int y6 = y3;

            label[q2]          = new Label();
            label[q2].Text     = Convert.ToString(sum1) + " $ Суммарная стоимость";
            label[q2].AutoSize = true;
            label[q2].Location = new Point(x6, y6);
            panel1.Controls.Add(label[q2]);
        }