Exemplo n.º 1
0
        private void transportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TransportForm tf = new TransportForm();

            tf.MdiParent = this;

            if (sender.ToString() == "Transport Suppliers")
            {
                tf.AllowJustView();
            }

            this.Show();
        }
Exemplo n.º 2
0
        private void clientsDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            if (e.ColumnIndex == 8)
            {
                _selectedClientId        = Convert.ToInt32(clientsDataGridView.Rows[e.RowIndex].Cells["clientId"].Value);
                _selectedClientFirstName = clientsDataGridView.Rows[e.RowIndex].Cells["firstName"].Value.ToString();
                _selectedClientLastName  = clientsDataGridView.Rows[e.RowIndex].Cells["lastName"].Value.ToString();
                _selectedClientAddress   = clientsDataGridView.Rows[e.RowIndex].Cells["address"].Value.ToString();
                _selectedClientJMBG      = clientsDataGridView.Rows[e.RowIndex].Cells["JMBG"].Value.ToString();
                _selectedClientBPG       = clientsDataGridView.Rows[e.RowIndex].Cells["BPG"].Value.ToString();
                _selectedClientZipCode   = clientsDataGridView.Rows[e.RowIndex].Cells["zipCode"].Value.ToString();
                _selectedClientPhone     = clientsDataGridView.Rows[e.RowIndex].Cells["phone"].Value.ToString();
                Client client = new Client(_selectedClientId, _selectedClientFirstName, _selectedClientLastName, _selectedClientAddress,
                                           string.Empty, _selectedClientJMBG, _selectedClientBPG, _selectedClientZipCode, string.Empty, _selectedClientPhone,
                                           string.Empty, string.Empty, string.Empty);

                _clientInfo = $"{_selectedClientFirstName} {_selectedClientLastName} ({_selectedClientJMBG})";
                switch (_childForm)
                {
                case "InsertForm":
                {
                    Hide();
                    using InsertForm insertForm = new InsertForm(client);
                    insertForm.ShowDialog(this);
                    if (!IsDisposed)
                    {
                        Show();
                    }
                    break;
                }

                case "RentPackagesForm":
                {
                    Hide();
                    using RentPackagesForm rentPackagesForm = new RentPackagesForm(_selectedClientId, _clientInfo);
                    rentPackagesForm.ShowDialog(this);
                    if (!IsDisposed)
                    {
                        Show();
                    }
                    break;
                }

                case "TransportForm":
                {
                    //Client client = new Client(_selectedClientId, _selectedClientFirstName, _selectedClientLastName, _selectedClientAddress,
                    //                           string.Empty, _selectedClientJMBG, _selectedClientBPG, _selectedClientZipCode, string.Empty, _selectedClientPhone,
                    //                           string.Empty, string.Empty, string.Empty);
                    Hide();
                    using TransportForm transportForm = new TransportForm(client);
                    transportForm.ShowDialog(this);
                    if (!IsDisposed)
                    {
                        Show();
                    }
                    break;
                }
                    //case "ChooseStorageRentingMethodForm":
                    //    {
                    //        Hide();
                    //        using InsertForm insertForm = new InsertForm(client);
                    //        insertForm.ShowDialog(this);
                    //        if (!IsDisposed)
                    //        {
                    //            Show();
                    //        }
                    //        break;
                    //    }
                }
            }
        }