Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            invoicePaymentInvoiceId = textBox1.Text.Trim();
            con.Open();
            string     query = "UPDATE TBL_INVOICE SET NUM_Istatus = 2 WHERE NUM_invoiceID= " + textBox1.Text.Trim() + ";";
            SqlCommand cmd   = new SqlCommand(query, con);

            cmd.ExecuteNonQuery();
            con.Close();


            if (vi == null)
            {
                vi             = new ViewInvoice();
                vi.MdiParent   = this.MdiParent;
                vi.FormClosed += new FormClosedEventHandler(vi_FormClosed);
                vi.Show();
                this.Close();
            }
            else
            {
                vi.Activate();
                vi.FormClosed += new FormClosedEventHandler(vi_FormClosed);
                vi.Show();
            }
            MessageBox.Show("Vendor Paid.");
        }
Пример #2
0
 private void viewInvoicesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (view_i == null)
     {
         view_i             = new ViewInvoice();
         view_i.MdiParent   = this;
         view_i.FormClosed += new FormClosedEventHandler(view_i_FormClosed);
         view_i.Show();
         //this.Close();
     }
     else
     {
         view_i.Activate();
     }
 }
Пример #3
0
 private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     invoice = this.dataGridView2.CurrentRow.Cells[0].Value.ToString();
     if (vi == null)
     {
         vi             = new ViewInvoice();
         vi.MdiParent   = this.MdiParent;
         vi.FormClosed += new FormClosedEventHandler(vi_FormClosed);
         vi.Show();
         //this.Close();
     }
     else
     {
         vi.Activate();
         vi.FormClosed += new FormClosedEventHandler(vi_FormClosed);
         vi.Show();
     }
 }
Пример #4
0
 void vi_FormClosed(object sender, FormClosedEventArgs e)
 {
     vi = null;
 }