private void button2_Click(object sender, EventArgs e)
        {
            Item newItem = CreateNewItem();

            if (newItem != null)
            {
                string resultMessage = StorageHandler.AddItemOnRack(newItem.NumberOfRack, newItem);
                MessageBox.Show(resultMessage);
            }
        }
        static private void WriteHeader()
        {
            string header = $"========================================================================== { Environment.NewLine}" +
                            $"Выгрузка от {DateTime.Now} {Environment.NewLine}" +
                            $"========================================================================== {Environment.NewLine}" +
                            $"Общий вес товара на складе {StorageHandler.GetTotalWeight()} килограммов {Environment.NewLine}" +
                            $"Общий объём товара на складе {StorageHandler.GetTotalVolume()} кубических сантиметров {Environment.NewLine}" +
                            $"========================================================================== { Environment.NewLine}";

            File.AppendAllText(fileName, header);
        }
Beispiel #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                StorageHandler.DeleteItem(currentSelectedItemId);

                currentSelectedItemId         = -1;
                this.dataGridView1.DataSource = StorageHandler.GetAllItemsForDataGridView();
            }
            catch (Exception)
            {
            }
        }
Beispiel #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         var item = new Item(currentSelectedItemId, Convert.ToInt32(itemCode.Text), itemName.Text, Convert.ToInt32(itemWeight.Text),
                             Convert.ToInt32(itemVolume.Text),
                             itemSupplier.Text, Convert.ToInt32(itemNumberOfRack.Text),
                             Convert.ToDateTime(itemStartDateStoraging.Text), Convert.ToDateTime(itemEndDateStoraging.Text));
         StorageHandler.UpdateItem(item);
         this.dataGridView1.DataSource = StorageHandler.GetAllItemsForDataGridView();
     }
     catch (Exception)
     {
         MessageBox.Show("Введены неверные параметры");
     }
 }
Beispiel #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     FileWritter.WriteItemsToFile(StorageHandler.GetAllItemsForFileWritter());
 }
Beispiel #6
0
 public MainForm()
 {
     InitializeComponent();
     StorageHandler.Init();
 }
Beispiel #7
0
 private void AllItemsView_Load(object sender, EventArgs e)
 {
     this.dataGridView1.DataSource = StorageHandler.GetAllItemsForDataGridView();
     dataGridView1.ReadOnly        = true;
 }