示例#1
0
        public void activate_final()
        {
            label_error.Hide();
            pictureBox_error.Hide();
            this.BackColor = Color.White;
            label_balance.Show();
            label_final.Show();
            label_getmoney.Show();
            label_time.Show();
            for (int i = 0; i < user.GetData().Rows.Count; i++)
            {
                if (frm.number() == user.GetData().Rows[i]["CarNumber"].ToString())
                {
                    User first = new User(user.GetData().Rows[i]["FirstName"].ToString(),
                       user.GetData().Rows[i]["LastName"].ToString(),
                       DateTime.Parse(user.GetData().Rows[i]["BirthDay"].ToString()),
                       Double.Parse(user.GetData().Rows[i]["Balance"].ToString()),
                       user.GetData().Rows[i]["CarNumber"].ToString(),
                       user.GetData().Rows[i]["TelephoneNumber"].ToString(),
                       DateTime.Parse(user.GetData().Rows[i]["LastEnter"].ToString()),
                       DateTime.Parse(user.GetData().Rows[i]["LastQuit"].ToString()));

                    label_time.Text = "Время вашего пребывания: " + first.getTime() + " мин";
                    label_getmoney.Text = "С Вашего счета списано: " + first.getChangesInBalance() + " руб.";

                    userInfo.newInfo(userInfo.GetData().Rows.Count + 1, "Списание", frm.number(), double.Parse(user.GetData().Rows[i]["Balance"].ToString()),
                            first.getChangesInBalance(), first.getTime().ToString(), first.getBalance(), DateTime.Now);

                    user.updateBalance(first.getBalance(), frm.number());
                    label_balance.Text = "На Вашем счете осталось: " + user.GetData().Rows[i]["Balance"].ToString() + " руб.";
                    user.updateParking(false, frm.number());
                }
            }
            float time = 0;
            Timer timer = new Timer();
            timer.Tick += new EventHandler((sender, e) =>
            {
                if ((time += 1) >= 3600)
                {
                    this.BackColor = Color.Black;
                    label_error.Hide();
                    label_balance.Hide();
                    label_final.Hide();
                    label_getmoney.Hide();
                    label_time.Hide();
                    pictureBox_error.Hide();
                    timer.Stop();

                }
            });
            timer.Interval = 1;
            timer.Start();
        }
 private void button1_Click(object sender, EventArgs e)
 {
     tryBox();
     if ((textBox_password.Text.ToString() == "123456") && (tryPrice == true))
     {
         User user = new User();
         price.changePrice(double.Parse(textBox_price.Text), 1);
         form_operator.textBox_price.Text = price.GetData().Rows[0]["price"].ToString();
         user.changePrice(double.Parse(textBox_price.Text));
         MessageBox.Show("Стоимость изменена!");
         this.Close();
     }
     else
     {
         MessageBox.Show("Неверный пароль!");
     }
 }
 public Form_operator()
 {
     price = new DataSet1TableAdapters.PriceTableAdapter();
     screen.X=Screen.PrimaryScreen.Bounds.Width;
     screen.Y = Screen.PrimaryScreen.Bounds.Height;
     user = new DataSet1TableAdapters.UserQuerry1TableAdapter();
     userInfo = new DataSet1TableAdapters.UserInfoTableAdapter();
     InitializeComponent();
     Opacity = 0;
     Timer timer = new Timer();
     Price = new User();
     timer.Tick += new EventHandler((sender, e) =>
     {
         if ((Opacity += 0.08d) >= 1) timer.Stop();
     });
     timer.Interval = 5;
     timer.Start();
 }
示例#4
0
        public void activate_open()
        {
            pictureBox_error.Hide();
            this.BackColor = Color.White;
            label_name.ForeColor = Color.Green;
            label_balance.Show();
            label_name.Show();
            pictureBox_open.Show();
            for (int i = 0; i < user.GetData().Rows.Count; i++)
            {

                if (user.GetData().Rows[i]["CarNumber"].ToString() == frm.number())
                {
                    User first = new User();
                    label_name.Text = "Здравствуйте, " + user.GetData().Rows[i]["FirstName"].ToString()
                        + " " + user.GetData().Rows[i]["LastName"].ToString();
                    user.updateTimeEnter(DateTime.Now, frm.number());
                    label_balance.Text = "На вашем счете: " + user.GetData().Rows[i]["Balance"].ToString()+ " руб " + " \nМаксимальное время парковки: "
                        + ((int)(((int)(Double.Parse(user.GetData().Rows[i]["Balance"].ToString()) / (double)first.getPrice())) / 60)).ToString() + " час(ов) " + ((int)(((int)(Double.Parse(user.GetData().Rows[i]["Balance"].ToString()) / (double)first.getPrice())) % 60)).ToString() + " минут(ы) ";
                    user.updateParking(true, frm.number());
                }
            }
            float time = 0;
            Timer timer = new Timer();
            timer.Tick += new EventHandler((sender, e) =>
            {
                if ((time +=1) >= 7200)
                {
                    this.BackColor = Color.Black;
                    label_balance.Hide();
                    label_name.Hide();
                    pictureBox_open.Hide();
                    timer.Stop();

                }
            });
            timer.Interval = 1;
            timer.Start();
        }
示例#5
0
        private void Form_final_Load(object sender, EventArgs e)
        {
            this.Location = new Point(frm.Location.X - this.Width/2+20, frm.Location.Y+frm.Height+10);
            this.BackColor = Color.Black;
            label_error.Hide();
            label_balance.Hide();
            label_final.Hide();
            label_getmoney.Hide();
            label_time.Hide();
            pictureBox_error.Hide();
            for (int i = 0; i < user.GetData().Rows.Count; i++)
            {
                if (frm.number() == user.GetData().Rows[i]["CarNumber"].ToString())
                {
                    User first = new User(user.GetData().Rows[i]["FirstName"].ToString(),
                       user.GetData().Rows[i]["LastName"].ToString(),
                       DateTime.Parse(user.GetData().Rows[i]["BirthDay"].ToString()),
                       Double.Parse(user.GetData().Rows[i]["Balance"].ToString()),
                       user.GetData().Rows[i]["CarNumber"].ToString(),
                       user.GetData().Rows[i]["TelephoneNumber"].ToString(),
                       DateTime.Parse(user.GetData().Rows[i]["LastEnter"].ToString()),
                       DateTime.Parse(user.GetData().Rows[i]["LastQuit"].ToString()));

                    label_time.Text = "Время вашего пребывания: " + first.getTime() + " мин";
                    label_getmoney.Text = "С Вашего счета списано: " + first.getChangesInBalance() + " руб.";

                    userInfo.newInfo(userInfo.GetData().Rows.Count+1,"Списание", frm.number(), double.Parse(user.GetData().Rows[i]["Balance"].ToString()),
                            first.getChangesInBalance(),first.getTime().ToString(),first.getBalance(),DateTime.Now);

                    user.updateBalance(first.getBalance(), frm.number());
                    label_balance.Text = "На Вашем счете осталось: " + user.GetData().Rows[i]["Balance"].ToString() + " руб.";
                    user.updateParking(false, frm.number());
                }
            }
        }
示例#6
0
        private void Form_open_Load(object sender, EventArgs e)
        {
            this.Location = new Point(frm.Location.X - form_operator.Width-235, frm.Location.Y + form_operator.Height+10);
            this.BackColor = Color.Black;
            label_balance.Hide();
            label_name.Hide();
            pictureBox_open.Hide();
            for (int i = 0; i < user.GetData().Rows.Count; i++)
            {

                if (user.GetData().Rows[i]["CarNumber"].ToString() == frm.number())
                {
                    User first = new User();
                    label_name.Text = "Здравствуйте, " + user.GetData().Rows[i]["FirstName"].ToString()
                        + " " + user.GetData().Rows[i]["LastName"].ToString();
                    user.updateTimeEnter(DateTime.Now, frm.number());
                    label_balance.Text = "На вашем счете: " + user.GetData().Rows[i]["Balance"].ToString() + " руб." + " \nМаксимальное время парковки: "
                        + ((int)(Double.Parse(user.GetData().Rows[i]["Balance"].ToString())/(double)first.getPrice())).ToString() + " мин";
                    user.updateParking(true, frm.number());
                }
            }
        }