Пример #1
0
        private void btmCreate_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtName.Text) || string.IsNullOrEmpty(this.txtComments.Text))
            {
                MessageBox.Show("Please, fill all Textboxes!", "Atention", MessageBoxButton.OK, MessageBoxImage.Information);
                goto Exit;
            }
            WorkWithMF_Warehouse.CreateWH(this.txtName.Text, this.txtComments.Text);
            CheckControls.ClearTextBox(ref txtName, ref txtComments);

            Exit :;
        }
Пример #2
0
 private void cmbID_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         ID = Convert.ToInt32(cmbID.SelectedValue.ToString());
         CheckControls.ClearTextBox(ref this.txtName, ref this.txtComments);
         WorkWithMF_Warehouse.LoadWarehouseId(ID, ref this.txtName, ref txtComments);
     }
     catch (Exception)
     {
         ID = 0;
     }
 }
Пример #3
0
        private void btmDone_Click(object sender, RoutedEventArgs e)
        {
            if (CheckControls.VerifyIfTextboxIsNull(this.txtName, this.txtComments))
            {
                goto Exit;
            }

            if (WorkWithMF_Warehouse.EditWarehouse(ID, this.txtName, this.txtComments))
            {
                goto Exit;
            }

            ResetControls();

            Exit :;
        }
Пример #4
0
 private void ResetControls()
 {
     ID           = 0; cmbID.ItemsSource = null;
     txtName.Text = null; txtComments.Text = null;
     WorkWithMF_Warehouse.LoadComboBox(ref this.cmbID);
 }