Пример #1
0
        private DateTime return_end_time(int number)
        {
            boxlist.LoadList("boxes.xml");

            boxes box = new boxes();
            box = boxlist.ReturnMyClass(number);
            DateTime curr = DateTime.Now;
            DateTime rd = DateTime.Now;
            try
            {
                orderlist.LoadList("orders.xml");
            }
            catch (System.Exception ex)
            {
            }

            ordering order = new ordering();

            for (int i = 0; i < orderlist.coun(); i++)
            {
                order = orderlist.ReturnMyClass(i);
                if (order.boxname == box.box_number)
                {
                    if (curr >= order.startdate && curr < order.enddate)
                    {
                        rd = order.enddate;
                    }
                }
            }

            return rd;
        }
Пример #2
0
        private void contextMenuStrip2_Opening(object sender, CancelEventArgs e)
        {
            PictureBox ppb = (PictureBox)((ContextMenuStrip)sender).SourceControl;
            string searchname;
            searchname = ppb.Name;
            if (File.Exists("boxes.xml"))
            {
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }
                string tmpboxname;

                boxes box = new boxes();
                box = boxlist.FindCLass(Mary_Louise_Parker(searchname));

                tmpboxname = box.box_number;

                if (box.box_status == "свободен")
                {
                    this.арендоватьМестоToolStripMenuItem.Enabled = true;
                    this.изменитьДанныеОТекущейАрендеToolStripMenuItem.Enabled = false;
                    this.завершитьТекущуюАрендуМестаToolStripMenuItem.Enabled = false;
                    this.арендаНаДругуюДатуToolStripMenuItem.Enabled = false;
                }
                else
                {
                    this.арендоватьМестоToolStripMenuItem.Enabled = false;
                    this.изменитьДанныеОТекущейАрендеToolStripMenuItem.Enabled = true;
                    this.завершитьТекущуюАрендуМестаToolStripMenuItem.Enabled = true;
                    this.арендаНаДругуюДатуToolStripMenuItem.Enabled = true;
                }

            }
        }
Пример #3
0
        private bool proverka_future_busy(int number)
        {
            boxlist.LoadList("boxes.xml");

            boxes box = new boxes();
            box = boxlist.ReturnMyClass(number);

            if (File.Exists("orders.xml"))
            {
                try
                {
                    orderlist.LoadList("orders.xml");
                }
                catch (System.Exception ex)
                {
                }

                int flag = 0;
                ordering order = new ordering();

                for (int i = 0; i < orderlist.coun(); i++)
                {
                    order = orderlist.ReturnMyClass(i);
                    if (order.boxname == box.box_number)
                        flag = 1;
                }

                if (flag == 0)
                    return false;
                else
                    return true;
            }
            else
                return false;
        }
Пример #4
0
        private void pbclick(string str1, string str2, string str3)
        {
            if (File.Exists("boxes.xml"))
            {
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }

                string tmpboxname;
                int tmpnum;

                if (radioButton1.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str1);
                    tmpboxname = box.box_number;
                    tmpnum = box.n;

                    if (box.box_status == "свободен")
                    {
                        info_box infobox = new info_box(tmpboxname, 1);
                        infobox.ShowDialog();
                        scarlett_johansson();
                        iRefreshForm(0);
                    }
                    else
                    {
                        info_box infobox = new info_box(tmpboxname, 0);
                        infobox.ShowDialog();
                        iRefreshForm(0);
                    }
                }
                else if (radioButton2.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str2);
                    tmpboxname = box.box_number;
                    tmpnum = box.n;

                    if (box.box_status == "свободен")
                    {
                        info_box infobox = new info_box(tmpboxname, 1);
                        infobox.ShowDialog();
                        scarlett_johansson();
                        iRefreshForm(12);
                    }
                    else
                    {
                        info_box infobox = new info_box(tmpboxname, 0);
                        infobox.ShowDialog();
                        iRefreshForm(12);
                    }
                }
                else if (radioButton3.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str3);
                    tmpboxname = box.box_number;
                    tmpnum = box.n;

                    if (box.box_status == "свободен")
                    {
                        info_box infobox = new info_box(tmpboxname, 1);
                        infobox.ShowDialog();
                        scarlett_johansson();
                        iRefreshForm(24);
                    }
                    else
                    {
                        info_box infobox = new info_box(tmpboxname,0);
                        infobox.ShowDialog();
                        iRefreshForm(24);
                    }
                }
            }
        }
Пример #5
0
        private void pictures(int i)
        {
            int h = i;
            string temp;
            boxlist.LoadList("boxes.xml");
            boxes obj = new boxes();
            //i
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label16.Text = "Свободен до";
                    label17.Text = tmpdate.ToShortDateString();
                    label18.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label16.Text = "";
                    label17.Text = "";
                    label18.Text = "";
                }
                this.pictureBox1.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label16.Text = "Занят до";
                label17.Text = tmpdate.ToShortDateString();
                label18.Text = tmpdate.ToLongTimeString();

                this.pictureBox1.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+1
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label21.Text = "Свободен до";
                    label20.Text = tmpdate.ToShortDateString();
                    label19.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label21.Text = "";
                    label20.Text = "";
                    label19.Text = "";
                }
                this.pictureBox2.Image = global::kursovaya.Properties.Resources.free;
            }

            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label21.Text = "Занят до";
                label20.Text = tmpdate.ToShortDateString();
                label19.Text = tmpdate.ToLongTimeString();

                this.pictureBox2.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+2
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label24.Text = "Свободен до";
                    label23.Text = tmpdate.ToShortDateString();
                    label22.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label24.Text = "";
                    label23.Text = "";
                    label22.Text = "";
                }

                this.pictureBox3.Image = global::kursovaya.Properties.Resources.free;
            }

            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label24.Text = "Занят до";
                label23.Text = tmpdate.ToShortDateString();
                label22.Text = tmpdate.ToLongTimeString();

                this.pictureBox3.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+3
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label27.Text = "Свободен до";
                    label26.Text = tmpdate.ToShortDateString();
                    label25.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label27.Text = "";
                    label26.Text = "";
                    label25.Text = "";
                }

                this.pictureBox4.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label27.Text = "Занят до";
                label26.Text = tmpdate.ToShortDateString();
                label25.Text = tmpdate.ToLongTimeString();

                this.pictureBox4.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+4
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label30.Text = "Свободен до";
                    label29.Text = tmpdate.ToShortDateString();
                    label28.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label30.Text = "";
                    label29.Text = "";
                    label28.Text = "";
                }

                this.pictureBox5.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label30.Text = "Занят до";
                label29.Text = tmpdate.ToShortDateString();
                label28.Text = tmpdate.ToLongTimeString();

                this.pictureBox5.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+5
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label33.Text = "Свободен до";
                    label32.Text = tmpdate.ToShortDateString();
                    label31.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label33.Text = "";
                    label32.Text = "";
                    label31.Text = "";
                }

                this.pictureBox6.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label33.Text = "Занят до";
                label32.Text = tmpdate.ToShortDateString();
                label31.Text = tmpdate.ToLongTimeString();

                this.pictureBox6.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+6
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label36.Text = "Свободен до";
                    label35.Text = tmpdate.ToShortDateString();
                    label34.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label36.Text = "";
                    label35.Text = "";
                    label34.Text = "";
                }

                this.pictureBox7.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label36.Text = "Занят до";
                label35.Text = tmpdate.ToShortDateString();
                label34.Text = tmpdate.ToLongTimeString();

                this.pictureBox7.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+7
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label39.Text = "Свободен до";
                    label38.Text = tmpdate.ToShortDateString();
                    label37.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label39.Text = "";
                    label38.Text = "";
                    label37.Text = "";
                }

                this.pictureBox8.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label39.Text = "Занят до";
                label38.Text = tmpdate.ToShortDateString();
                label37.Text = tmpdate.ToLongTimeString();

                this.pictureBox8.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+8
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label42.Text = "Свободен до";
                    label41.Text = tmpdate.ToShortDateString();
                    label40.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label42.Text = "";
                    label41.Text = "";
                    label40.Text = "";
                }

                this.pictureBox9.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label42.Text = "Занят до";
                label41.Text = tmpdate.ToShortDateString();
                label40.Text = tmpdate.ToLongTimeString();

                this.pictureBox9.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+9
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label45.Text = "Свободен до";
                    label44.Text = tmpdate.ToShortDateString();
                    label43.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label45.Text = "";
                    label44.Text = "";
                    label43.Text = "";
                }

                this.pictureBox10.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label45.Text = "Занят до";
                label44.Text = tmpdate.ToShortDateString();
                label43.Text = tmpdate.ToLongTimeString();

                this.pictureBox10.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+10
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label48.Text = "Свободен до";
                    label47.Text = tmpdate.ToShortDateString();
                    label46.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label48.Text = "";
                    label47.Text = "";
                    label46.Text = "";
                }

                this.pictureBox11.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label48.Text = "Занят до";
                label47.Text = tmpdate.ToShortDateString();
                label46.Text = tmpdate.ToLongTimeString();

                this.pictureBox11.Image = global::kursovaya.Properties.Resources.busy;
            }
            h++;
            //i+11
            obj = boxlist.ReturnMyClass(h);
            temp = obj.box_status;
            if (temp == "свободен")
            {
                if (proverka_future_busy(h))
                {
                    DateTime tmpdate;
                    tmpdate = return_start_time(h);
                    label51.Text = "Свободен до";
                    label50.Text = tmpdate.ToShortDateString();
                    label49.Text = tmpdate.ToLongTimeString();
                }
                else
                {
                    label51.Text = "";
                    label50.Text = "";
                    label49.Text = "";
                }

                this.pictureBox12.Image = global::kursovaya.Properties.Resources.free;
            }
            if (temp == "занят")
            {
                DateTime tmpdate;
                tmpdate = return_end_time(h);
                label51.Text = "Занят до";
                label50.Text = tmpdate.ToShortDateString();
                label49.Text = tmpdate.ToLongTimeString();

                this.pictureBox12.Image = global::kursovaya.Properties.Resources.busy;
            }
        }
Пример #6
0
        private void stripinfoclick(string str1, string str2, string str3)
        {
            if (File.Exists("boxes.xml"))
            {
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }

                string tmpboxname;

                if (radioButton1.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str1);
                    tmpboxname = box.box_number;

                    info_box infobox = new info_box(tmpboxname,0);
                    infobox.ShowDialog();
                    iRefreshForm(0);
                }
                else if (radioButton2.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str2);
                    tmpboxname = box.box_number;

                    info_box infobox = new info_box(tmpboxname,0);
                    infobox.ShowDialog();
                    iRefreshForm(12);
                }
                else if (radioButton3.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str3);
                    tmpboxname = box.box_number;

                    info_box infobox = new info_box(tmpboxname, 0);
                    infobox.ShowDialog();
                    iRefreshForm(24); ;
                }
            }
        }
Пример #7
0
        private void stripremoveclick(string str1, string str2, string str3)
        {
            if (File.Exists("boxes.xml"))
            {
                DialogResult dialogResult = MessageBox.Show("Вы точно хотите удалить эти данные из базы?", "Удаление данных", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dialogResult == DialogResult.Yes)
                {

                    try
                    {
                        boxlist.LoadList("boxes.xml");
                    }
                    catch (System.Exception ex)
                    {
                        Close();
                    }

                    try
                    {
                        orderlist.LoadList("orders.xml");
                    }
                    catch (System.Exception ex)
                    {
                        Close();
                    }

                    string tmpboxname;
                    DateTime currr;
                    currr = DateTime.Now;

                    if (radioButton1.Checked == true)
                    {
                        boxes box = new boxes();
                        box = boxlist.FindCLass(str1);
                        tmpboxname = box.box_number;

                        ordering norder = new ordering();
                        int fl = 999;
                        for (int i = 0; i < orderlist.coun(); i++)
                        {
                            norder = orderlist.ReturnMyClass(i);
                            if (norder.boxname == tmpboxname)
                            {
                                if (currr >= norder.startdate && currr <= norder.enddate)
                                    fl = i;
                            }
                        }

                        norder = orderlist.ReturnMyClass(fl);
                        orderlist.RemoveMyClass(tmpboxname, norder.enddate);
                        orderlist.SaveList("orders.xml");
                        iRefreshForm(0);
                    }
                    else if (radioButton2.Checked == true)
                    {
                        boxes box = new boxes();
                        box = boxlist.FindCLass(str2);
                        tmpboxname = box.box_number;

                        ordering norder = new ordering();
                        int fl = 999;
                        for (int i = 0; i < orderlist.coun(); i++)
                        {
                            norder = orderlist.ReturnMyClass(i);
                            if (norder.boxname == tmpboxname)
                            {
                                if (currr >= norder.startdate && currr <= norder.enddate)
                                    fl = i;
                            }
                        }

                        norder = orderlist.ReturnMyClass(fl);

                        orderlist.RemoveMyClass(tmpboxname, norder.enddate);
                        orderlist.SaveList("orders.xml");
                        iRefreshForm(12);
                    }
                    else if (radioButton3.Checked == true)
                    {
                        boxes box = new boxes();
                        box = boxlist.FindCLass(str3);
                        tmpboxname = box.box_number;

                        ordering norder = new ordering();
                        int fl = 999;
                        for (int i = 0; i < orderlist.coun(); i++)
                        {
                            norder = orderlist.ReturnMyClass(i);
                            if (norder.boxname == tmpboxname)
                            {
                                if (currr >= norder.startdate && currr <= norder.enddate)
                                    fl = i;
                            }
                        }

                        norder = orderlist.ReturnMyClass(fl);

                        orderlist.RemoveMyClass(tmpboxname, norder.enddate);
                        orderlist.SaveList("orders.xml");
                        iRefreshForm(24);
                    }
                }
                else if (dialogResult == DialogResult.No)
                {
                }
            }
        }
Пример #8
0
        private void sortir(int nnn)
        {
            try
            {
                boxlist.LoadList("boxes.xml");
            }
            catch (System.Exception ex)
            {
                File.Delete("boxes.xml");
            }

            boxes a = new boxes();
            boxes b = new boxes();
            boxes c = new boxes();
            int sh = 36 - nnn;
            while (sh > 1)
            {
                a = boxlist.ReturnMyClass(nnn);
                boxlist.RemoveMyClass(a.box_number);
                boxlist.AddMyClass(a);
                boxlist.SaveList("boxes.xml");
                sh--;
            }
        }
Пример #9
0
        private void stripchangeclick(string str1, string str2, string str3)
        {
            if (File.Exists("boxes.xml"))
            {
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }

                try
                {
                    orderlist.LoadList("orders.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }

                string tmpboxname;
                DateTime currr;
                currr = DateTime.Now;

                if (radioButton1.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str1);
                    tmpboxname = box.box_number;

                    ordering norder = new ordering();
                    int fl = 999;
                    for (int i = 0; i < orderlist.coun(); i++)
                    {
                        norder = orderlist.ReturnMyClass(i);
                        if (norder.boxname == tmpboxname)
                        {
                            if (currr >= norder.startdate && currr <= norder.enddate)
                                fl = i;
                        }
                    }

                    norder = orderlist.ReturnMyClass(fl);

                    edit_order edord = new edit_order(tmpboxname, norder.enddate);
                    edord.ShowDialog();
                    iRefreshForm(0);
                }
                else if (radioButton2.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str2);
                    tmpboxname = box.box_number;

                    ordering norder = new ordering();
                    int fl = 999;
                    for (int i = 0; i < orderlist.coun(); i++)
                    {
                        norder = orderlist.ReturnMyClass(i);
                        if (norder.boxname == tmpboxname)
                        {
                            if (currr >= norder.startdate && currr <= norder.enddate)
                                fl = i;
                        }
                    }

                    norder = orderlist.ReturnMyClass(fl);

                    edit_order edord = new edit_order(tmpboxname, norder.enddate);
                    edord.ShowDialog();
                    iRefreshForm(12);
                }
                else if (radioButton3.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str3);
                    tmpboxname = box.box_number;

                    ordering norder = new ordering();
                    int fl = 999;
                    for (int i = 0; i < orderlist.coun(); i++)
                    {
                        norder = orderlist.ReturnMyClass(i);
                        if (norder.boxname == tmpboxname)
                        {
                            if (currr >= norder.startdate && currr <= norder.enddate)
                                fl = i;
                        }
                    }

                    norder = orderlist.ReturnMyClass(fl);

                    edit_order edord = new edit_order(tmpboxname, norder.enddate);
                    edord.ShowDialog();
                    iRefreshForm(24);
                }
            }
        }
Пример #10
0
        private void CreateBoxes()
        {
            if (File.Exists("boxes.xml")) boxlist.LoadList("boxes.xml");
            boxes obj = new boxes();
            obj.n = 0;
            obj.box_number = "";
            obj.box_status = "свободен";
            obj.box_current_owner_login = "";

            for (int i = 0; i < 36; i++)
            {
                if (File.Exists("boxes.xml")) boxlist.LoadList("boxes.xml");
                if (i >= 0 && i < 12)
                {
                    obj.box_number = "А" + (i + 1).ToString();
                    obj.n = i;
                }
                if (i >= 12 && i < 24)
                {
                    obj.box_number = "Б" + (i - 12 + 1).ToString();
                    obj.n = i;
                }
                if (i >= 24 && i < 36)
                {
                    obj.box_number = "В" + (i - 24 + 1).ToString();
                    obj.n = i;
                }
                boxlist.AddMyClass(obj);
                boxlist.SaveList("boxes.xml");
            }
        }
Пример #11
0
        private void scarlett_johansson()
        {
            if (File.Exists("orders.xml"))
            {
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }

                boxes box = new boxes();
                ordering order = new ordering();
                DateTime currDateTime = DateTime.Now;

                for (int i = 0; i < boxlist.coun(); i++)
                {
                    box = boxlist.ReturnMyClass(i);
                    int flag = 0;

                    try
                    {
                        orderlist.LoadList("orders.xml");
                    }
                    catch (System.Exception ex)
                    {
                        Close();
                    }

                    for (int j = 0; j < orderlist.coun(); j++)
                    {
                        order = orderlist.ReturnMyClass(j);
                        if (box.box_number == order.boxname)
                        {
                            if (currDateTime >= order.startdate && currDateTime <= order.enddate)
                            {
                                box.box_status = "занят";
                                box.box_current_owner_login = order.box_owner_login;

                                boxlist.RemoveMyClass(box.box_number);
                                boxlist.AddMyClass(box);
                                boxlist.SaveList("boxes.xml");
                                sortir(box.n);
                                flag = 1;
                            }

                            if (currDateTime > order.enddate)
                            {
                                orderlist.RemoveMyClass(order.boxname, order.enddate);
                                orderlist.SaveList("orders.xml");
                            }
                        }
                    }
                    //конец фора по j

                    if (flag == 0)
                    {
                        if (box.box_status != "свободен")
                        {
                            box.box_status = "свободен";
                            box.box_current_owner_login = "******";

                            boxlist.RemoveMyClass(box.box_number);
                            boxlist.AddMyClass(box);
                            boxlist.SaveList("boxes.xml");
                            sortir(box.n);
                        }
                    }
                }
                //конец фора по i
            }
        }
Пример #12
0
        private void Init()
        {
            this.Text = "Информация о стояночном месте - " + tmpboxname;
            this.label2.Text = "Место " + tmpboxname;

            if (File.Exists("orders.xml"))
            {
                try
                {
                    orderlist.LoadList("orders.xml");
                }
                catch (System.Exception ex)
                {
                    File.Delete("orders.xml");
                }
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    File.Delete("boxes.xml");
                }

                boxes box = new boxes();
                box = boxlist.FindCLass(tmpboxname);

                if (box.box_status == "свободен")
                {
                    empty();
                }
                else
                {
                    DateTime d1;
                    d1 = DateTime.Now;

                    ordering order = new ordering();
                    for (int i = 0; i < orderlist.coun(); i++)
                    {
                        order = orderlist.ReturnMyClass(i);
                        if (order.boxname == tmpboxname)
                        {
                            if (d1 >= order.startdate && d1 <= order.enddate)
                            {
                                textBox1.Text = "занят";
                                dateTimePicker2.Value = order.enddate;
                                dateTimePicker3.Value = order.enddate;
                            }
                        }
                    }
                }
            }
            else
                empty();
        }
Пример #13
0
        private void striparendclick(string str1, string str2, string str3)
        {
            if (File.Exists("boxes.xml"))
            {
                try
                {
                    boxlist.LoadList("boxes.xml");
                }
                catch (System.Exception ex)
                {
                    Close();
                }

                string tmpboxname;
                int tmpnum;

                if (radioButton1.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str1);
                    tmpboxname = box.box_number;
                    tmpnum = box.n;

                    info_order_user orderbox = new info_order_user(tmpboxname, PLogin, 1);
                    orderbox.ShowDialog();
                    scarlett_johansson();
                    iRefreshForm(0);

                }
                else if (radioButton2.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str2);
                    tmpboxname = box.box_number;
                    tmpnum = box.n;

                    info_order_user orderbox = new info_order_user(tmpboxname, PLogin, 1);
                    orderbox.ShowDialog();
                    scarlett_johansson();
                    iRefreshForm(12);
                }
                else if (radioButton3.Checked == true)
                {
                    boxes box = new boxes();
                    box = boxlist.FindCLass(str3);
                    tmpboxname = box.box_number;
                    tmpnum = box.n;

                    info_order_user orderbox = new info_order_user(tmpboxname, PLogin, 1);
                    orderbox.ShowDialog();
                    scarlett_johansson();
                    iRefreshForm(24);
                }
            }
        }
Пример #14
0
 public void AddMyClass(boxes myclass)
 {
     boxList.Add(myclass);
 }