示例#1
0
        private void dataTables_DoubleClick(object sender, EventArgs e)
        {
            SqlConnector.Connect();
            if (checkModifications == 4)
            {
                int selectedRow = dataTables.CurrentRow.Index;

                int currenCustomerId = GetSelectedId(0);
                NewCustomerPanel newCustomerPanel = new NewCustomerPanel(this, 4, userName);
                newCustomerPanel.tbFirstname.Text    = dataTables.Rows[selectedRow].Cells[1].Value.ToString();
                newCustomerPanel.tbLastname.Text     = dataTables.Rows[selectedRow].Cells[2].Value.ToString();
                newCustomerPanel.tbCompany.Text      = dataTables.Rows[selectedRow].Cells[3].Value.ToString();
                newCustomerPanel.tbCompanyEmail.Text = dataTables.Rows[selectedRow].Cells[4].Value.ToString();
                newCustomerPanel.tbCompanyPhone.Text = dataTables.Rows[selectedRow].Cells[5].Value.ToString();
                newCustomerPanel.tbEmail.Text        = dataTables.Rows[selectedRow].Cells[6].Value.ToString();
                newCustomerPanel.tbPostalcode.Text   = dataTables.Rows[selectedRow].Cells[7].Value.ToString();
                newCustomerPanel.tbCity.Text         = dataTables.Rows[selectedRow].Cells[8].Value.ToString();
                newCustomerPanel.tbStreetnumber.Text = dataTables.Rows[selectedRow].Cells[9].Value.ToString();
                newCustomerPanel.tbProvince.Text     = dataTables.Rows[selectedRow].Cells[10].Value.ToString();
                newCustomerPanel.tbPhone.Text        = dataTables.Rows[selectedRow].Cells[11].Value.ToString();
                newCustomerPanel.tbFaxnumber.Text    = dataTables.Rows[selectedRow].Cells[12].Value.ToString();
                newCustomerPanel.tbInsurance.Text    = dataTables.Rows[selectedRow].Cells[13].Value.ToString();
                newCustomerPanel.Show();
                this.Hide();
            }
            else if (checkModifications == 1)
            {
                int selectedRow = dataTables.CurrentRow.Index;

                NewProjectPanel newProjectPanel = new NewProjectPanel(this, GetSelectedId(0), checkModifications, userName);
                newProjectPanel.tbProjectName.Text = dataTables.Rows[selectedRow].Cells[2].Value.ToString();
                newProjectPanel.tbDescription.Text = dataTables.Rows[selectedRow].Cells[3].Value.ToString();
                newProjectPanel.datePicker.Text    = dataTables.Rows[selectedRow].Cells[6].Value.ToString();
                newProjectPanel.tbPrice.Text       = dataTables.Rows[selectedRow].Cells[7].Value.ToString();
                newProjectPanel.Show();
                this.Hide();
            }
            else if (checkModifications == 3)
            {
                OpenChangeVisibility(dataTables.Rows[dataTables.CurrentRow.Index], dataTables.Rows[0].Cells.Count, " isVisible", false);
            }
            else if (checkModifications == 0)
            {
                OpenChangeVisibility(dataTables.Rows[dataTables.CurrentRow.Index], dataTables.Rows[0].Cells.Count - 1, " completed", true);
            }
            else if (checkModifications == 5)
            {
                int selectedRow = dataTables.CurrentRow.Index;

                NewInvoicePanel form = new NewInvoicePanel(this, userName, true, "modify");
                form.tbFactuurbedrag.Text           = dataTables.Rows[selectedRow].Cells[2].Value.ToString();
                form.datePicker.Text                = dataTables.Rows[selectedRow].Cells[3].Value.ToString();
                form.tbGrootboekrekeningnummer.Text = dataTables.Rows[selectedRow].Cells[4].Value.ToString();
                form.tbBtwCode.Text = dataTables.Rows[selectedRow].Cells[5].Value.ToString();
                form.Show();
            }
        }
示例#2
0
        private void btnAddInvoice_Click(object sender, EventArgs e)
        {
            isEdit = false;
            NewInvoicePanel newinvoicepanel = new NewInvoicePanel(this, userName, isEdit, "add");

            SqlConnector.Connect();
            newinvoicepanel.Show();
            this.Hide();
        }