private void btnIn_Click(object sender, EventArgs e) { String userName = frmLogin.User.user_name; DialogResult dr = MessageBox.Show("Do You Wish to Continue?", "Continue", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == System.Windows.Forms.DialogResult.Yes) { CashStatus = "In"; try { vo.CashAmount = Convert.ToDouble(txtBoxAmount.Text); vo.DrawerPurpose = txtBoxPurpose.Text; vo.Pos_terminal = lblTerminal.Text; vo.Pos_user = userName; vo.CreditD(); lblCID.Text = vo.DrawerBalance().ToString("#,###,##0.00"); drawers = new Conf.Drawer(); drawers.Open(); PrintTicket(); txtBoxPurpose.Clear(); txtBoxAmount.Clear(); txtBoxAmount.Focus(); } catch (Exception) { MessageBox.Show("Check Database Server!", "Database Server", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnOut_Click(object sender, EventArgs e) { String userName = frmLogin.User.user_name; DialogResult dr = MessageBox.Show("Do You Wish to Continue?", "Continue", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == System.Windows.Forms.DialogResult.Yes) { CashStatus = "Out"; if (txtBoxPurpose.Text != "") { vo.CashAmount = Convert.ToDouble(txtBoxAmount.Text); vo.DrawerPurpose = txtBoxPurpose.Text; vo.Pos_terminal = lblTerminal.Text; vo.Pos_user = userName; vo.DebitD(); lblCID.Text = vo.DrawerBalance().ToString("#,###,##0.00"); drawers = new Conf.Drawer(); drawers.Open(); PrintTicket(); txtBoxPurpose.Clear(); txtBoxAmount.Clear(); txtBoxAmount.Focus(); } else { MessageBox.Show("Please State Your Purpose!", "Cash In Drawer Management", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtBoxPurpose.Focus(); } } }
private void DrawerPing() { try { Conf.Drawer drawer = new Conf.Drawer(); drawer.Open(); } catch (Exception) { MessageBox.Show("Check Cash Drawer Please!", "Drawer Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnPay_Click(object sender, EventArgs e) { VO.PosVO pos = new VO.PosVO(); frmLogin fl = new frmLogin(); try { DialogResult dlg = MessageBox.Show("Do you wish to Proceed the Payment", "Payment", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dlg == System.Windows.Forms.DialogResult.Yes) { Double prePayable = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[2].Value); Double preBalance = Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[4].Value); customer = new VO.CustomersVO(); pos.Pos_terminal = fl.tN; customer.Pos_terminal = fl.tN; customer.Pos_orno = pos.GetOrNo(); customer.Custcode = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); customer.Customer = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); customer.Pos_user = frmLogin.User.user_name; customer.Balance = Convert.ToDouble(txtBoxAmount.Text); if (customer.JustCheckVat() == true) { customer.Vatable = Convert.ToDouble(txtBoxAmount.Text); } else { customer.Vatable = 0; } customer.AmountPaid = Convert.ToDouble(txtBoxAmount.Text); customer.Custcode = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); customer.DebitToAccount(); customer.PayToSale(); //NEW dataGridView1.SelectedRows[0].Cells[3].Value = Convert.ToDouble(txtBoxAmount.Text); dataGridView1.SelectedRows[0].Cells[4].Value = preBalance - Convert.ToDouble(txtBoxAmount.Text); if (Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[4].Value) == 0) { dataGridView1.SelectedRows[0].Cells[2].Value = Convert.ToDouble(0); } drawer = new Conf.Drawer(); drawer.Open(); PrintPayments(); txtBoxAmount.Clear(); btnPay.Enabled = false; } } catch (Exception) { MessageBox.Show("Please Your Database Server!", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }