private void mtbSearch_Click(object sender, EventArgs e)
        {
            // check if OPNo is valid
            int OPNo = int.Parse(tOPNo.Text);
            float temp = 0;
            string query = "SELECT * FROM tbl_PayOrder WHERE OPNo = " + OPNo;

            if (new clsDB().Con().countRecord(query) > 0)
            {
                // Compute Total
                query = "SELECT AcctCode, Particular, Amount FROM tbl_PayOrder_Details WHERE OPSeqNo = '" + OPNo + "'";

                new clsDB().Con().FillLvw(listView1, query);
                float[] total = Payor.computeAccount(listView1);
                temp = total[0] + total[1];
                frmPaymentDataEntry f = new frmPaymentDataEntry();
                f.total = temp;
                f.orderOfPaymentNo = OPNo;
                f.listLength = listView1.Items.Count;
                f.ShowDialog();
            }
            else
            {

                MessageBox.Show("Invalid Order of Payment Number", "Input Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void mtbSearch_Click(object sender, EventArgs e)
        {
            // check if OPNo is valid
            int    OPNo  = int.Parse(tOPNo.Text);
            float  temp  = 0;
            string query = "SELECT * FROM tbl_PayOrder WHERE OPNo = " + OPNo;

            if (new clsDB().Con().countRecord(query) > 0)
            {
                // Compute Total
                query = "SELECT AcctCode, Particular, Amount FROM tbl_PayOrder_Details WHERE OPSeqNo = '" + OPNo + "'";

                new clsDB().Con().FillLvw(listView1, query);
                float[] total = Payor.computeAccount(listView1);
                temp = total[0] + total[1];
                frmPaymentDataEntry f = new frmPaymentDataEntry();
                f.total            = temp;
                f.orderOfPaymentNo = OPNo;
                f.listLength       = listView1.Items.Count;
                f.ShowDialog();
            }
            else
            {
                MessageBox.Show("Invalid Order of Payment Number", "Input Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 3
0
        private void mtbSearch_Click(object sender, EventArgs e)
        {
            // check if OPNo is valid
            int OPNo = 0;

            try
            {
                OPNo = int.Parse(tOPNo.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Invalid OP Number");
                return;
            }

            float  temp  = 0;
            string query = "SELECT * FROM tbl_PayOrder WHERE OPNo = " + OPNo;

            if (new clsDB().Con().countRecord(query) > 0)
            {
                // Compute Total
                query = "SELECT AcctCode, Particular, Amount FROM tbl_PayOrder_Details WHERE OPSeqNo = '" + OPNo + "'";

                new clsDB().Con().FillLvw(listView1, query);
                float[] total = Payor.computeAccount(listView1);
                temp = total[0] + total[1];
                frmPaymentDataEntry f = new frmPaymentDataEntry(this.lastORNumber);
                f.total            = temp;
                f.orderOfPaymentNo = OPNo;
                f.listLength       = listView1.Items.Count;
                f.ShowDialog();
                this.lastORNumber = f.lastORNumber;


                parent.lbTotalCollection.Text = "" + Cashier.classes.clsCollection.getDailyAccumulatedAmount(DateTime.Now.ToShortDateString());
                string date = DateTime.Now.ToShortDateString();
                Cashier.classes.clsCollection c       = new Cashier.classes.clsCollection();
                Dictionary <string, float>    summary = c.summaryOfCollection(2, date);

                for (int i = 0; i < summary.Count; i++)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.SubItems[0].Text = summary.Keys.ToList()[i];
                    ListViewItem.ListViewSubItem item = new ListViewItem.ListViewSubItem();
                    item.Text = Convert.ToString(summary[summary.Keys.ToList()[i]]);
                    lvi.SubItems.Add(item);


                    parent.lvSummaryOfCollection.Items.Add(lvi);
                }
            }
            else
            {
                MessageBox.Show("Invalid Order of Payment Number", "Input Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 4
0
 private void btnPay_Click(object sender, EventArgs e)
 {
     if (lvManageRecord.SelectedItems.Count > 0)
     {
         frmPaymentDataEntry f = new frmPaymentDataEntry();
         f.total            = temp;
         f.orderOfPaymentNo = orderOfPaymentID;
         f.listLength       = listView1.Items.Count;
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show(" Please Select an item");
     }
 }
 private void btnPay_Click(object sender, EventArgs e)
 {
     if (lvManageRecord.SelectedItems.Count > 0)
     {
         frmPaymentDataEntry f = new frmPaymentDataEntry();
         f.total = temp;
         f.orderOfPaymentNo = orderOfPaymentID;
         f.listLength = listView1.Items.Count;
         f.ShowDialog();
     }
     else
         MessageBox.Show(" Please Select an item");
 }