예제 #1
0
        private void button_car_Click(object sender, EventArgs e)
        {
            check = false;
            for (int i = 0; i < user.GetData().Rows.Count; i++)
            {
                if ((number() == user.GetData().Rows[i]["CarNumber"].ToString()))
                {
                    check = true;
                    if ((double.Parse(user.GetData().Rows[i]["Balance"].ToString()) > 0) && (user.GetData().Rows[i]["OnParking"].ToString() == false.ToString()))
                    {
                        user.updateTimeEnter(DateTime.Now, comboBox_num.Text.ToString());

                        form_open.activate_open();
                        frm.logChang(number(), "Въезд");
                    }
                    else
                    {
                        form_open.open_error();
                    }
                }
            }
            if (check == false)
            {
                form_open.open_error();
                new_lable();
            }
        }
예제 #2
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());
         }
     }
 }