Exemplo n.º 1
0
        private void btnAddParticular_Click(object sender, EventArgs e)
        {
            frmParticulars f = new frmParticulars();

            f.ShowDialog();
            string[][] data = f.checkedItems;
            string[]   col  = new string[f.listView1.Columns.Count];

            if (f.listView1.CheckedItems.Count > 0)
            {
                for (int i = 0; i < f.listView1.Columns.Count; i++)
                {
                    col[i] = f.listView1.Columns[i].Text;
                }
                try
                {
                    if (new clsDB().Con().listViewTransferData(data, lvDataEntryOP, col))
                    {
                        f.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                try
                {
                    float[] account = Payor.computeAccount(lvDataEntryOP);
                    lbTotal.Text = Convert.ToString(account[1]);
                    tAmount.Text = Convert.ToString(account[1]);
                }
                catch (Exception ex)
                {
                    lvDataEntryOP.Items.Clear();
                    MessageBox.Show("Particular Has no Amount");
                }
            }
        }
        private void btnAddParticular_Click(object sender, EventArgs e)
        {
            frmParticulars f = new frmParticulars();
            f.ShowDialog();
            string[][] data = f.checkedItems;
            string[] col = new string[f.listView1.Columns.Count];

            if (f.listView1.CheckedItems.Count > 0)
            {
                for (int i = 0; i < f.listView1.Columns.Count; i++)
                {
                    col[i] = f.listView1.Columns[i].Text;
                }
                try
                {
                    if (new clsDB().Con().listViewTransferData(data, lvDataEntryOP, col))
                    {
                        f.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                try
                {
                    float[] account = Payor.computeAccount(lvDataEntryOP);
                    lbTotal.Text = Convert.ToString(account[1]);
                    tAmount.Text = Convert.ToString(account[1]);
                }
                catch (Exception ex)
                {
                    lvDataEntryOP.Items.Clear();
                    MessageBox.Show("Particular Has no Amount");
                }

            }
        }