Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridViewRow item in dataGridView1.Rows)
                {
                    printJkk.Tables["DataTable1"].Rows.Add(item.Cells[1].Value.ToString(), item.Cells[2].Value.ToString(), item.Cells[3].Value.ToString(), item.Cells[4].Value.ToString(), textBox6.Text, textBox4.Text, textBox5.Text, textBox12.Text, item.Cells[0].Value.ToString(), "", addd.CUSTIDENTs.ToString(), textBox9.Text);
                }

                Printing.print3 frm = new OrderManagementSystem.Printing.print3();
                frm.Prints = printJkk;
                frm.ShowDialog();
                printJkk.Tables["DataTable1"].Rows.Clear();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Payment.EMPID2   = Convert.ToDouble(textBox10.Text);
                Payment.TOTALL2  = Convert.ToDouble(textBox6.Text);
                Payment.REMAIN2  = Convert.ToDouble(textBox9.Text);
                Payment.CUSTBAL2 = Convert.ToDouble(textBox7.Text);
                Payment.TOTALPAYMENTSSSSSSSSS = Convert.ToDouble(textBox5.Text);
                Payment.BALANCEEEEEEEE        = Convert.ToDouble(textBox9.Text);
                Payment.CreatePaymentsReceipt(addd.KKK, addd.CUSTIDENTs);
            }
            catch (Exception)
            {
                MessageBox.Show("Error. Enter credit");
            }
            try
            {
                conn.Open();
                if (conn.State == ConnectionState.Open)
                {
                    SqlDataReader dr = gett.ViewhighestReceiptNO(conn);
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            label10.Text = dr[0].ToString();
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally { conn.Close(); }

            try
            {
                addd.CUSTIDENTs = Convert.ToInt32(addd.CUSTIDDDDDDDDDD[listBox2.SelectedIndex]);
                conn.Open();
                if (conn.State == ConnectionState.Open)
                {
                    SqlDataReader dr = addd.SelectCustomerOrders_TotalPaaids(conn);
                    if (dr.HasRows)
                    {
                        textBox12.Clear();
                        while (dr.Read())
                        {
                            textBox12.Text   = dr[0].ToString();
                            textBox6.Enabled = true;
                        }
                    }
                    else
                    {
                        textBox12.Text = "0";
                    }
                }
            }
            catch (Exception)
            {
                DialogResult okay = new DialogResult();
                okay = MessageBox.Show("Click on the item!", "Inventory", MessageBoxButtons.OK, MessageBoxIcon.Error);
                if (okay == DialogResult.OK)
                {
                    Application.DoEvents();
                }
            }
            finally { conn.Close(); }

            try
            {
                foreach (DataGridViewRow item in dataGridView1.Rows)
                {
                    printJkk.Tables["DataTable1"].Rows.Add(item.Cells[1].Value.ToString(), item.Cells[2].Value.ToString(), item.Cells[3].Value.ToString(), item.Cells[4].Value.ToString(), textBox6.Text, textBox4.Text, textBox5.Text, textBox12.Text, item.Cells[0].Value.ToString(), label10.Text, addd.CUSTIDENTs.ToString(), textBox9.Text);
                }

                Printing.print3 frm = new OrderManagementSystem.Printing.print3();
                frm.Prints = printJkk;
                frm.ShowDialog();
                printJkk.Tables["DataTable1"].Rows.Clear();
            }
            catch (Exception)
            {
                throw;
            }
        }