Exemplo n.º 1
0
 private void txtBoxAmount_TextChanged(object sender, EventArgs e)
 {
     if (txtBoxAmount.Text != "" && txtBoxAmount.Text != "0.00" && txtBoxAmount.Text != "0")
     {
         if (Regex.IsMatch(txtBoxAmount.Text, r.Amount()))
         {
             if (Convert.ToDouble(txtBoxAmount.Text) <= Convert.ToDouble(dataGridView1.SelectedRows[0].Cells[4].Value) && Convert.ToDouble(txtBoxAmount.Text) != 0)
             {
                 txtBoxAmount.ReadOnly = false;
                 btnPay.Enabled        = true;
             }
             else
             {
                 btnPay.Enabled = false;
                 txtBoxAmount.Focus();
             }
         }
         else
         {
             btnPay.Enabled = false;
             txtBoxAmount.Focus();
         }
     }
     else
     {
         txtBoxAmount.Focus();
         btnPay.Enabled = false;
     }
 }
Exemplo n.º 2
0
 private void txtBoxTender_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (Regex.IsMatch(txtBoxTender.Text, r.Amount()))
         {
             if (GetAmount <= Convert.ToDouble(txtBoxTender.Text))
             {
                 pos = new VO.PosVO();
                 frmLogin fl = new frmLogin();
                 pos.Pos_terminal = fl.tN;
                 TenderAmount     = Convert.ToDouble(txtBoxTender.Text);
                 pos.IncAmt       = TenderAmount;
                 pos.IncD();
                 ChangeDue  = TenderAmount - getAmount;
                 pos.DecAmt = ChangeDue;
                 pos.DecD();
                 IsCashTX = true;
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Insufficient Amount!\nPlease Try Again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show("Please Enter Tender Amount Propery!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemplo n.º 3
0
        private void txtBoxTender_KeyDown(object sender, KeyEventArgs e)
        {
            cstDlgAlert alert = new cstDlgAlert();

            if (e.KeyCode == Keys.Enter)
            {
                if (Regex.IsMatch(txtBoxTender.Text, r.Amount()))
                {
                    if (GetAmount <= Convert.ToDouble(txtBoxTender.Text))
                    {
                        pos = new VO.PosVO();
                        frmLogin fl = new frmLogin();
                        pos.Pos_terminal = fl.tN;
                        TenderAmount     = Convert.ToDouble(txtBoxTender.Text);
                        pos.IncAmt       = TenderAmount;
                        pos.IncD();
                        ChangeDue  = TenderAmount - getAmount;
                        pos.DecAmt = ChangeDue;
                        pos.DecD();
                        IsCashTX = true;
                        this.Close();
                    }
                    else
                    {
                        alert.MsgDiri = "Insufficient Amount!";
                        alert.ShowDialog();
                    }
                }
                else
                {
                    alert.MsgDiri = "Please Enter Tender Amount Properly!";
                    alert.ShowDialog();
                }
            }
        }
Exemplo n.º 4
0
 private void txtBoxAmount_TextChanged(object sender, EventArgs e)
 {
     if (Regex.IsMatch(txtBoxAmount.Text, r.Amount()))
     {
         txtBoxPurpose.ReadOnly = false;
     }
     else
     {
         txtBoxPurpose.ReadOnly = true;
     }
     if (Regex.IsMatch(txtBoxAmount.Text, r.Amount()) && txtBoxPurpose.Text != "")
     {
         btnIn.Enabled = true;
     }
     else
     {
         btnIn.Enabled  = false;
         btnOut.Enabled = false;
     }
 }
Exemplo n.º 5
0
 private void txtBoxAmount_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (Regex.IsMatch(txtBoxAmount.Text, r.Amount()))
         {
             Searched     = true;
             FilterAmount = Convert.ToDouble(txtBoxAmount.Text);
             this.Close();
         }
         else
         {
             MessageBox.Show("Please Enter the Amount Correctly!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemplo n.º 6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Do you wish to Continue?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            r = new Conf.Rgx();
            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    if (Regex.IsMatch(txtBoxAmount.Text, r.Amount()))
                    {
                        dataGridView1.Rows.Add(txtBoxCardNo.Text, Convert.ToDouble(txtBoxAmount.Text), txtBoxHolder.Text, Convert.ToDateTime(dateTimePicker1.Text).ToString("M/dd/yyy"));
                        //
                        gift               = new VO.GiftCardVO();
                        gift.Gc_cardno     = txtBoxCardNo.Text;
                        gift.Gc_amount     = Convert.ToDouble(txtBoxAmount.Text);
                        gift.Gc_holder     = txtBoxHolder.Text;
                        gift.Gc_validuntil = Convert.ToDateTime(dateTimePicker1.Text);
                        gift.AddGC();
                        //Event
                        txtBoxHolder.Clear();
                        txtBoxAmount.Clear();
                        txtBoxCardNo.Clear();
                        txtBoxCardNo.Focus();
                    }
                    else
                    {
                        MessageBox.Show("Please Enter the Amount Properly", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Please Check Database Server!", "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }