コード例 #1
0
ファイル: MainWindow.cs プロジェクト: slavkur/WarehouseApp
 /*EVENT*/
 private void tsmiInvoiceBlank_Click(object sender, EventArgs e)
 {
     InvoiceForm form = new InvoiceForm(getInvoiceLogBlank().NewRow(), getStockId());
     form.FormClosed += new FormClosedEventHandler(Invoice_FormClosed);
     form.Show();
 }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: slavkur/WarehouseApp
        private void newInvoice(object sender, DataRow item)
        {
            int cll = 0;
            double kg = 0;
            double m3 = 0;
            DateTime departure;
            DateTime arrival;
            ToolStripMenuItem invoiceItem = (ToolStripMenuItem)sender;

            String consignor = dgvp.item("consignor").ToString();
            String whNumber = dgvp.item("wh_number").ToString();
            String ccsNumber = dgvp.item("ccs_number").ToString();
            String status = dgvp.item("status").ToString();
            String bookingNumber = dgvp.item("booking_number").ToString();
            String invoiceNumber = (invoiceItem.Tag != null) ? invoiceItem.Tag.ToString() : null;
            DateTime.TryParse(dgvp.item("departure").ToString(), out departure);
            DateTime.TryParse(dgvp.item("arrival").ToString(), out arrival);
            int.TryParse(dgvp.item("cll_doc").ToString(), out cll);
            double.TryParse(dgvp.item("kg_doc").ToString(), out kg);
            double.TryParse(dgvp.item("m3").ToString(), out m3);

            InvoiceForm form = new InvoiceForm(conn, item, getStockId(), cll, kg, m3, ccsNumber, whNumber, bookingNumber, invoiceNumber, consignor, departure, arrival, status);
            form.invoiceNumberCreated += new InvoiceForm.InvoiceEventHandler(form_invoiceNumberCreated);
            form.FormClosed += new FormClosedEventHandler(Invoice_FormClosed);
            form.Show();
        }