Exemplo n.º 1
0
 private void TablesDataGridViewInitialize()
 {
     TablesDataGridView.DataSource = FileClass.TableGrid();
     TablesDataGridView.Columns["TableNumber"].HeaderText = "Номер столика";
     TablesDataGridView.Columns["PlaceCount"].HeaderText  = "Количество мест";
     TablesDataGridView.Columns["Color"].HeaderText       = "Цвет";
     TablesDataGridView.Columns["FormFactor"].HeaderText  = "Форма";
     TablesDataGridView.Columns["Material"].HeaderText    = "Материал";
     TablesDataGridView.Columns["Status"].HeaderText      = "Статус";
     TablesDataGridView.Columns["Owner"].HeaderText       = "Клиент";
     TablesDataGridView.Columns["Image"].Visible          = false;
 }
Exemplo n.º 2
0
 public DetailsForm(bool IsNewList)
 {
     InitializeComponent();
     CenterToScreen();
     buttonRemove.Visible = false;
     this._table          = new Table();
     if (IsNewList)
     {
         TableNumTextBox.Text = "1";
     }
     else
     {
         TableNumTextBox.Text = Convert.ToString(FileClass.GetNewElementNum() + 1);
     }
     comboBoxStatus.SelectedItem = "Свободен";
     textBoxOwnerName.Text       = "NaN";
     ButtonSave.Click           += SaveButton_ClickForAdd;
 }
Exemplo n.º 3
0
 private void SaveButton_ClickForSave(object sender, EventArgs e)
 {
     if (!CheckFields())
     {
         string[] value = { TableNumTextBox.Text.Trim(),
                            PlaceCountTextBox.Text.Trim(),
                            comboBoxColor.SelectedItem.ToString(),
                            comboBoxForm.SelectedItem.ToString(),
                            comboBoxMaterial.SelectedItem.ToString(),
                            comboBoxStatus.SelectedItem.ToString(),
                            textBoxOwnerName.Text,
                            pictureBox.ImageLocation };
         Int16    _tableNum = Int16.Parse(TableNumTextBox.Text);
         FileClass.ChangeFile(_tableNum, value);
         this.Close();
     }
     else
     {
         MessageBox.Show("Проверьте корректность введеных данных", "Ошибка", MessageBoxButtons.OK);
     }
 }
Exemplo n.º 4
0
 public Table(Int16 ID)
     : this(FileClass.ReadFromFile(ID))
 {
 }
Exemplo n.º 5
0
 private void buttonRemove_Click(object sender, EventArgs e)
 {
     FileClass.RemoveFromFile(this._table.TableNumber);
     this.Close();
 }