public TimeLimited(ALEmanCafeServer ACS, NetworkItems NI)
 {
     InitializeComponent();
     this.ACS = ACS;
     this.NI  = NI;
     this.TimeTextBox.KeyDown += new KeyEventHandler(TimeTextBox_KeyDown);
     TimeTextBox.TextChanged  += new EventHandler(TimeTextBox_TextChanged);
     TimeTextBox.SelectAll();
 }
Esempio n. 2
0
        private void ClearButton_Click(object sender, EventArgs e)
        {
            PrincipalTextBox.Clear();
            RateTextBox.Clear();
            TimeTextBox.Clear();



            ShowAnswerTextBox.Clear();
        }
Esempio n. 3
0
        //Next step:  Make animations vs. state interpolations visibly different in the tree view

        private void TextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == System.Windows.Input.Key.Enter)
            {
                // your event handler here
                e.Handled = true;

                // Make it lose and regain focus to apply the databainding
                Focusable.Focus();

                //InterpolationTypeComboBox.Focus();
                TimeTextBox.Focus();
            }
        }
Esempio n. 4
0
 public SellingOperate(ALEmanCafeServer ACS2, ProductsInfos PI)
 {
     InitializeComponent();
     this.PI   = PI;
     this.ACS2 = ACS2;
     this.TimeTextBox.KeyDown += new KeyEventHandler(TimeTextBox_KeyDown);
     TimeTextBox.TextChanged  += new EventHandler(TimeTextBox_TextChanged);
     TimeTextBox.SelectAll();
     maskedTextBox1.Text = PI.Price + (Program.OrLanguage == true ? " EGP" : " جنيه");
     if (Program.OrLanguage == false)
     {
         this.Text = "عملية بيع/إسترجاع"; this.RightToLeft = RightToLeft.Yes; label3.Text = "البيع والإسترجاع"; label1.Text = "الكمية "; label2.Text = "السعر"; CancelCloseButton.Text = "خروج"; OKButton.Text = "حسناً";
     }
 }
 /// <summary>
 /// 车牌识别结果
 /// </summary>
 /// <param name="ChIp"></param>
 /// <param name="ChLicesen"></param>
 /// <param name="ChColor"></param>
 /// <param name="ChTime"></param>
 public void PlateResult(string ChIp, string ChLicesen, string ChColor, DateTime ChTime)
 {
     if (TimeTextBox.InvokeRequired)
     {
         TimeTextBox.Invoke(new UpdatePlate(PlateResult), new object[] { ChIp, ChLicesen, ChColor, ChTime });
     }
     else
     {
         TimeTextBox.Text  = ChTime.ToString("yyyy-MM-dd HH:mm:ss");
         IpTextBox.Text    = ChIp;
         PlateTextBox.Text = ChLicesen;
         ColorTextBox.Text = ChColor;
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 车牌结果
 /// </summary>
 /// <param name="Ip"></param>
 /// <param name="Plate"></param>
 /// <param name="Color"></param>
 /// <param name="Time"></param>
 private void PlateDataInfoOut(string Ip, string Plate, string Color, string Time)
 {
     if (TimeTextBox.InvokeRequired)
     {
         TimeTextBox.Invoke(new PlateDataDelegate(PlateDataInfoOut), new object[] { Ip, Plate, Color, Time });
     }
     else
     {
         TimeTextBox.Text  = Time;
         IpTextBox.Text    = Ip;
         PlateTextBox.Text = Plate;
         ColorTextBox.Text = Color;
         PlateResultEvent(string.Format("Plate Result Time:{0} Plate:{1}", Time, Plate));
     }
 }
Esempio n. 7
0
        public override void DetachEditingControl()
        {
            System.Windows.Forms.DataGridView dataGridView = this.DataGridView;
            if (dataGridView == null || dataGridView.EditingControl == null)
            {
                throw new InvalidOperationException("Cell is detached or its grid has no editing control.");
            }

            TimeTextBox editBox = dataGridView.EditingControl as TimeTextBox;

            if (editBox != null)
            {
                editBox.ClearUndo();  // avoid interferences between the editing sessions
            }

            base.DetachEditingControl();
        }
Esempio n. 8
0
        /// <summary>
        /// Starts Sandpile movement after stock vertices are selected
        /// </summary>
        private void StockLabel_Click(object sender, EventArgs e)
        {
            if (SandpilePanel.Size.Height > 60)
            {
                return;
            }
            SandpilePanel.Visible = false;
            TimeTextBox.Visible   = true;
            SandpileLabel.Enabled = false;
            TimeTextBox.BringToFront();
            SandpileLabel.Text = @"Select vertex to add a grain of sand to       ";
            SandpileLabel.Font = new Font("Segoe UI", 9);
            SandpilePanel.Size = new Size(SandpilePanel.Size.Width, 91);

            movement.MovementEnded += MovementEndedSandpileEventHandler;

            movement.StartMovementModeling();
        }
Esempio n. 9
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            string name      = NameTextBox.Text;
            string writter   = WritterTextBox.Text;
            string time      = TimeTextBox.Text;
            string publisher = PublishTextBox.Text;
            string page      = PageTextBox.Text;
            string id        = NumberTextBox.Text;

            Thread thread = new Thread(threadStart);

            thread.Start();

            Book deletebook = new Book();

            for (int i = 0; i < remineder.Count; i++)
            {
                if (name == remineder[i].name && writter == remineder[i].writter && time == remineder[i].time &&
                    publisher == remineder[i].publisher && page == remineder[i].page && id == remineder[i].ID)
                {
                    IsRightForm isright = new IsRightForm();
                    if (isright.show())
                    {
                        deletebook.Delete(i);
                        BookDataGridView.Rows.Clear();
                        NumberTextBox.Clear();
                        NameTextBox.Clear();
                        WritterTextBox.Clear();
                        TimeTextBox.Clear();
                        PublishTextBox.Clear();
                        PageTextBox.Clear();
                        ShowAllBook();
                        break;
                    }
                }
                else if (i == remineder.Count - 1)
                {
                    MessageBox.Show("此书不存在");
                    break;
                }
            }
            //摧毁线程
            thread.Abort();
        }
Esempio n. 10
0
        /// <summary>
        /// Prepares MovementModeling instance for modeling the movement
        /// </summary>
        /// <param name="type">Modeling type</param>
        /// <param name="actions">Additional actions</param>
        /// <param name="sandpileChartTypes">Sandpile chart types</param>
        private bool PrepareMovementModeling(MovementModelingType type,
                                             MovementModelingActions[] actions,
                                             SandpileChartType[] sandpileChartTypes)
        {
            movement = new MovementModeling(digraph, (double)SpeedNumeric.Value / 1000, type, actions)
            {
                GraphDrawing       = graphDrawing,
                DrawingSurface     = DrawingSurface,
                SandpileChartTypes = sandpileChartTypes
            };

            isOnMovement            = true;
            movement.Tick          += UpdateElapsedTime;
            movement.MovementEnded += StopToolStripMenuItem_Click;

            MovementToolStripMenuItem.Text    = @"Continue";
            MovementToolStripMenuItem.Enabled = false;
            StopToolStripMenuItem.Enabled     = true;

            if (type == MovementModelingType.Sandpile)
            {
                graphDrawing.DrawTheWholeGraphSandpile(digraph, true);
                DrawingSurface.Image  = graphDrawing.Image;
                SandpilePanel.Visible = true;
                SandpilePanel.BringToFront();
                return(true);
            }

            if (SaveGifCheckBox.Checked)
            {
                movement.MovementEnded += SaveGif;
            }
            movement.MovementEnded += (s, ea) =>
            {
                movement.Tick -= UpdateElapsedTime;
                movement       = null;
            };

            TimeTextBox.Visible = true;
            TimeTextBox.BringToFront();
            return(false);
        }
Esempio n. 11
0
        public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
        {
            base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
            TimeTextBox editBox = this.DataGridView.EditingControl as TimeTextBox;

            if (editBox != null)
            {
                editBox.BorderStyle = BorderStyle.None;

                string initialFormattedValueStr = initialFormattedValue as string;

                if (string.IsNullOrEmpty(initialFormattedValueStr))
                {
                    editBox.Text = "";
                }
                else
                {
                    editBox.Text = initialFormattedValueStr;
                }
            }
        }
Esempio n. 12
0
        private void AddClick_Click(object sender, RoutedEventArgs e) // Кнопка добавления записи
        {
            MySqlConnection Connect = new MySqlConnection(connection);

            if (TaskDatePicker.Text.Length != 0 && TaskTextBox.Text != null && TimeTextBox.Text != null)  // Проверка условия: Дата, Задача и Время не пустые
            {
                using (MySqlCommand command = new MySqlCommand(@"select max(id) from Reminder", Connect)) // Переменная выполнения команды
                {
                    try
                    {
                        Connect.Open();                                   // Открываем базу данных
                        MySqlDataReader reader = command.ExecuteReader(); // Переменная чтения запроса выполненного переменной command
                        reader.Read();                                    // Читаем
                        var id = reader.GetValue(0).ToString();           // Переменная для добавления id в Базу данных, присваем значение максимально id в Базе данных
                        if (id == "")
                        {
                            id = "0";                                                                                                                                                                                                                                   // Проверяем если значение пустое, то присваиваем 0, так как в базе пусто
                        }
                        reader.Close();                                                                                                                                                                                                                                 // Закрываем чтение

                        Connect.Execute("INSERT INTO Reminder (ID,Task,StartTime,EndTime) VALUES (" + (Convert.ToInt16(id) + 1) + ",'" + TaskTextBox.Text + "','" + DateTime.UtcNow + "','" + Convert.ToDateTime(TaskDatePicker.Text + " " + TimeTextBox.Text) + "')"); // Выполняем запрос на добавление id, задачи, текущей даты и времени, Даты и Время выполнения задачи.
                        Connect.Close();                                                                                                                                                                                                                                // Закрываем базу данных
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        Connect.Close();
                    }
                    TaskTextBox.Clear();      // Очищаем TextBox
                    TaskDatePicker.Text = ""; // Присваиваем пусто
                    TimeTextBox.Clear();      // Очищаем TextBox
                }
                Refresh();                    // Запускаем метод для обновления DataGrid.
            }
            else
            {
                MessageBox.Show("Задача или Дата Пустые", "Error");
            }
        }