Пример #1
0
        private void btnReset_Click(object sender, EventArgs e)
        {
            if (!clsUtil.GetApproval(m_user, UserAccess.Supervisor))
            {
                return;
            }
            clsLoadAccount acc = GetSelAccount();

            if (acc != null)
            {
                if (acc.LoadType == LoadAccountType.GCash)
                {
                    if (MessageBox.Show(string.Format("Are you sure you want to reset Load Account to {0:0.00}?", Properties.Settings.Default.GCashResetAmount), "Reset Load", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        clsReloadHistory reload = new clsReloadHistory();
                        reload.Amount            = Convert.ToDouble(acc.CurrentBalance - Properties.Settings.Default.GCashResetAmount);
                        reload.Load_Id           = acc.LoadId;
                        reload.RefNum            = string.Format("RESETACCNT{0:yyyyMMddHHssmm}", DateTime.Now);
                        reload.Timestamp         = DateTime.Now;
                        reload.UserId            = m_user.UserId;
                        reload.Remarks           = "Reset GCASH Account";
                        reload.TransactionAmount = 0;
                        reload.RemainingBalance  = Properties.Settings.Default.GCashResetAmount;
                        if (reload.Save())
                        {
                            acc.CurrentBalance   = reload.RemainingBalance;
                            acc.AvailableBalance = reload.RemainingBalance;

                            if (acc.Save())
                            {
                                reload.PrintReceipt(acc);
                                ReloadAccounts();
                            }
                            else
                            {
                                MessageBox.Show("Account Balance was not reset!", "Reset Balance", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("This is only applicable to GCash Account", "Reset Balance", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Пример #2
0
        private void btnFundTransfer_Click(object sender, EventArgs e)
        {
            if (!clsUtil.GetApproval(m_user, UserAccess.Supervisor))
            {
                return;
            }
            clsLoadAccount acc = GetSelAccount();

            if (acc != null)
            {
                frmInput input = new frmInput();
                input.withDecimal   = true;
                input.IsNumericOnly = true;
                input.Value         = "";
                input.Title         = "Fund Transfer";
                input.Caption       = "Enter amount to transfer";
                if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    clsReloadHistory reload = new clsReloadHistory();
                    reload.Amount            = Convert.ToDouble(input.Value);
                    reload.Load_Id           = acc.LoadId;
                    reload.RefNum            = string.Format("FUNDTRANS{0:yyyyMMddHHssmm}", DateTime.Now);
                    reload.Timestamp         = DateTime.Now;
                    reload.UserId            = m_user.UserId;
                    reload.Remarks           = "Fund Transfer";
                    reload.TransactionAmount = 0;
                    reload.RemainingBalance  = acc.CurrentBalance - Convert.ToDouble(input.Value);
                    if (reload.Save())
                    {
                        acc.CurrentBalance   = reload.RemainingBalance;
                        acc.AvailableBalance = reload.RemainingBalance;
                        if (acc.Save())
                        {
                            reload.PrintReceipt(acc);
                            ReloadAccounts();
                        }
                        else
                        {
                            MessageBox.Show("Fund Transfer Failed!", "Fund Transfer", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
Пример #3
0
        private void btnReload_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(string.Format("Account Description:{0}\nReload Amount:{1:0.00}\nRemarks:{2}\n\nAre you sure this is correct?", txtDesc.Text, txtAmount.Text, txtRemarks.Text), "Reload Account", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                clsReloadHistory reload = new clsReloadHistory();
                reload.Amount            = Convert.ToDouble(txtAmount.Text);
                reload.Load_Id           = m_loadAct.LoadId;
                reload.RefNum            = string.Format("RELOAD{0:yyyyMMddHHssmm}", DateTime.Now);
                reload.Timestamp         = DateTime.Now;
                reload.UserId            = m_user.UserId;
                reload.Remarks           = txtRemarks.Text;
                reload.TransactionAmount = 0;

                reload.RemainingBalance = dbConnect.GetRemainingLoadBalance(m_loadAct.LoadId) + reload.Amount;
                if (reload.Save())
                {
                    m_loadAct.CurrentBalance   = reload.RemainingBalance;
                    m_loadAct.AvailableBalance = reload.RemainingBalance;

                    if (m_loadAct.Save())
                    {
                        reload.PrintReceipt(m_loadAct);
                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Account Balance was not updated!", "Reload", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Reload Failed!", "Reload", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }