Beispiel #1
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                clsSubDAccount subd = clsSubDAccount.GetSubDAccount(txtMobileNum.Text);

                clsLoadWalletTransaction wallet = new clsLoadWalletTransaction();
                wallet.Load_Id            = m_LoadAccount.LoadId;
                wallet.UserId             = myPosWide.m_user.UserId;
                wallet.SubDId             = subd != null ? subd.Id_subdAccounts : 0;
                wallet.Timestamp          = DateTime.Now;
                wallet.LoadAmount         = double.Parse(txtLoadAmount.Text);
                wallet.MobileNum          = txtMobileNum.Text;
                wallet.DiscountPercentage = double.Parse(txtDisCount.Text);
                wallet.AmtDue             = double.Parse(txtAmtDue.Text);

                frmInput input     = new frmInput();
                double   amountdue = wallet.AmtDue;
                input.Title   = "Payment";
                input.Value   = amountdue.ToString("0.00");
                input.Caption = "Enter Tendered Amount";

                if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (Convert.ToDouble(input.Value) >= amountdue)
                    {
                        wallet.TenderedAmount = Convert.ToDouble(input.Value);
                        if (wallet.Save())
                        {
                            Clear();
                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            wallet.PrintReceipt();
                            RefreshAccount();
                        }
                        else
                        {
                            MessageBox.Show("Transaction not saved.", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    else
                    {
                        if (MessageBox.Show("Amount entered is less than the Amount Due. Charge to Sub-D Account?", "Payment", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
                        {
                            wallet.TenderedAmount = Convert.ToDouble(input.Value);
                            if (wallet.Save())
                            {
                                Clear();
                                m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                                wallet.PrintReceipt();
                                RefreshAccount();
                            }
                            else
                            {
                                MessageBox.Show("Transaction not saved.", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (!clsUtil.GetApproval(m_user, UserAccess.Manager))
            {
                return;
            }
            clsLoadAccount acc = GetSelAccount();

            if (acc != null)
            {
                if (MessageBox.Show(string.Format("Are you sure you want to delete {0} with mobile number {1}?", acc.Description, acc.MobileNum), "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                {
                    bool ret = acc.Delete();
                    if (ret)
                    {
                        MessageBox.Show("It has been successfully Deleted.", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Failed to Delete the account.", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    ClearFields();
                    ReloadAccounts();
                }
            }
        }
Beispiel #3
0
 public frmReloadAccount(clsLoadAccount loadact, clsUsers user)
 {
     InitializeComponent();
     m_loadAct        = loadact;
     m_user           = user;
     txtDesc.Text     = m_loadAct.Description;
     txtCurBal.Text   = m_loadAct.CurrentBalance.ToString("0.00");
     txtAvailBal.Text = m_loadAct.AvailableBalance.ToString("0.00");
 }
Beispiel #4
0
        private void btnSubD_Click(object sender, EventArgs e)
        {
            clsLoadAccount ac = GetSelAccount();

            if (ac != null)
            {
                frmSubDAccounts subd = new frmSubDAccounts(ac);
                subd.ShowDialog();
            }
        }
Beispiel #5
0
        private void AddItemToGrid(clsLoadAccount act)
        {
            int rowidx = dgvLoadAccounts.Rows.Add();

            dgvLoadAccounts.Rows[rowidx].Cells[0].Value = act.LoadId;
            dgvLoadAccounts.Rows[rowidx].Cells[1].Value = act.AccountNum;
            dgvLoadAccounts.Rows[rowidx].Cells[2].Value = act.MobileNum;
            dgvLoadAccounts.Rows[rowidx].Cells[3].Value = act.Description;
            dgvLoadAccounts.Rows[rowidx].Cells[4].Value = act.CurrentBalance.ToString("0.00");
            dgvLoadAccounts.Rows[rowidx].Cells[5].Value = act.AvailableBalance.ToString("0.00");
        }
Beispiel #6
0
        private void DisplayAccounts()
        {
            if (_mLoadAccounts != null)
            {
                clsLoadAccount newact = new clsLoadAccount();
                newact.LoadType    = LoadAccountType.New;
                newact.Description = "Add/Edit Account";
                newact.LoadId      = -1;

                FileStream   fs;
                BinaryReader br;
                fs             = new FileStream(Application.StartupPath + "\\images\\addLoadAccount.png", FileMode.Open, FileAccess.Read);
                br             = new BinaryReader(fs);
                newact.ImgFile = br.ReadBytes((int)fs.Length);
                br.Close();
                fs.Close();
                _mLoadAccounts.Add(newact);
                int margin = 10;
                int left = 5, top = margin, ctr = 1;
                foreach (clsLoadAccount a in _mLoadAccounts)
                {
                    ctrlLoadAccount btn = CreateButton(a);
                    btn.Left   = left;
                    btn.Top    = top;
                    btn.Width  = Properties.Settings.Default.LoadBtnSize;
                    btn.Height = Properties.Settings.Default.LoadBtnSize;
                    pnlLoadAccount.Controls.Add(btn);
                    if (ctr >= Properties.Settings.Default.MaxLoadBtnCnt)
                    {
                        left = 5;
                        top += Properties.Settings.Default.LoadBtnSize + margin;
                        ctr  = 0;
                    }
                    else
                    {
                        left += Properties.Settings.Default.LoadBtnSize + margin;
                    }
                    ctr++;
                }
                pnlLoadAccount.Width = ((Properties.Settings.Default.LoadBtnSize + margin) * Properties.Settings.Default.MaxLoadBtnCnt) + margin;
                if (pnlLoadAccount.VerticalScroll.Visible)
                {
                    pnlLoadAccount.Width += 20;
                }

                //this.Height = ((Properties.Settings.Default.LoadBtnSize + margin) * (_mLoadAccounts.Count / Properties.Settings.Default.MaxLoadBtnCnt+ 1)) + margin;// top + (int)(Properties.Settings.Default.LoadBtnSize * 1.25);
                //this.Top = 0;
                //this.Left = 0;
                //this.Left = (SystemInformation.VirtualScreen.Width - this.Width) / 2;
                //this.Top = (SystemInformation.VirtualScreen.Height - this.Height) / 2;
            }
        }
Beispiel #7
0
        private void AddItemToGrid(clsEloadTransaction hist)
        {
            clsLoadAccount load   = clsLoadAccount.GetLoadAccount(hist.Load_Id);
            int            rowidx = dgvTrans.Rows.Add();

            dgvTrans.Rows[rowidx].Cells[0].Value = hist.Timestamp;
            dgvTrans.Rows[rowidx].Cells[1].Value = load.MobileNum;

            dgvTrans.Rows[rowidx].Cells[2].Value = hist.Transaction_Amount;
            dgvTrans.Rows[rowidx].Cells[3].Value = hist.AmountDue;
            dgvTrans.Rows[rowidx].Cells[4].Value = hist.Remarks;
            dgvTrans.Rows[rowidx].Cells[5].Value = hist.UserName;
        }
Beispiel #8
0
 public frmSmartMoneyTrans(clsLoadAccount act)
 {
     InitializeComponent();
     m_LoadAccount              = clsLoadAccount.GetLoadAccount(act.LoadId);
     txtSSAmount.KeyDown       += new KeyEventHandler(txtWithDec_KeyDown);
     txtSSSvcFee.KeyDown       += new KeyEventHandler(txtWithDec_KeyDown);
     txtCSAmount.KeyDown       += new KeyEventHandler(txtWithDec_KeyDown);
     txtCSSvcFee.KeyDown       += new KeyEventHandler(txtWithDec_KeyDown);
     txtSenderNum.KeyDown      += new KeyEventHandler(txtWithOutDec_KeyDown);
     txtSSRecipientNum.KeyDown += new KeyEventHandler(txtWithOutDec_KeyDown);
     txtCSSmartMoney.KeyDown   += new KeyEventHandler(txtWithOutDec_KeyDown);
     txtSSSmartMoney.KeyDown   += new KeyEventHandler(txtWithOutDec_KeyDown);
 }
Beispiel #9
0
        private void LoadAccount_Click(int LoadId)
        {
            clsLoadAccount a = _mLoadAccounts.Find(x => x.LoadId == LoadId);

            if (a != null)
            {
                //this.Close();
                if (a.LoadType == LoadAccountType.GCash)
                {
                    frmGlobeGCashTrans ec = new frmGlobeGCashTrans(a);
                    LoadMenuForm(ec);
                    //ec.Left = 0;
                    //ec.Top = 0;
                    //ec.ShowDialog();
                }
                else if (a.LoadType == LoadAccountType.SCash)
                {
                    frmSmartMoneyTrans ec = new frmSmartMoneyTrans(a);
                    LoadMenuForm(ec);
                    //ec.Left = 0;
                    //ec.Top = 0;
                    //ec.ShowDialog();
                }
                else if (a.LoadType == LoadAccountType.ELoad)
                {
                    frmELoadTrans el = new frmELoadTrans(a);
                    LoadMenuForm(el);
                    //el.Left = 0;
                    //el.Top = 0;
                    //el.ShowDialog();
                }
                else if (a.LoadType == LoadAccountType.New)
                {
                    frmLoadAccounts act = new frmLoadAccounts(_mUser);
                    act.ShowDialog();
                    //LoadMenuForm(act);
                    pnlLoadAccount.Controls.Clear();
                    _mLoadAccounts = clsLoadAccount.GetLoadAccounts();
                    DisplayAccounts();
                }
                else
                {
                    frmLoadWalletTrans lw = new frmLoadWalletTrans(a);
                    LoadMenuForm(lw);
                    //lw.Left = 0; ;
                    //lw.Top = 0; ;

                    //lw.ShowDialog();
                }
            }
        }
Beispiel #10
0
        private void btnSvcFee_Click(object sender, EventArgs e)
        {
            if (!clsUtil.GetApproval(m_user, UserAccess.Supervisor))
            {
                return;
            }
            clsLoadAccount acc = GetSelAccount();

            if (acc != null)
            {
                frmServiceFee svc = new frmServiceFee(acc);
                svc.ShowDialog();
            }
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string         cashier         = cboCashier.SelectedItem.ToString();
            clsLoadAccount SelectedAccount = m_lstAccountInfo.Find(x => x.Description == cboLoadAcc.Text);
            int            loadid          = SelectedAccount != null ? SelectedAccount.LoadId : 0;
            clsUsers       SelectedUser    = lstUsers.Find(x => x.UserName == cboCashier.Text);
            int            userid          = SelectedUser != null ? SelectedUser.UserId : 0;

            if (cashier == "All")
            {
                cashier = "";
            }
            SearchReloadHistory(dtPickStart.Value, dtPickEnd.Value, userid, loadid);
        }
        private void AddItemToGrid(clsReloadHistory hist)
        {
            clsLoadAccount load   = clsLoadAccount.GetLoadAccount(hist.Load_Id);
            int            rowidx = dgvReload.Rows.Add();

            dgvReload.Rows[rowidx].Cells[0].Value = hist.Timestamp;
            dgvReload.Rows[rowidx].Cells[1].Value = load.Description;
            dgvReload.Rows[rowidx].Cells[2].Value = hist.RefNum;
            dgvReload.Rows[rowidx].Cells[3].Value = hist.Amount;
            dgvReload.Rows[rowidx].Cells[4].Value = hist.TransactionAmount;
            dgvReload.Rows[rowidx].Cells[5].Value = hist.RemainingBalance;
            dgvReload.Rows[rowidx].Cells[6].Value = hist.Remarks;
            dgvReload.Rows[rowidx].Cells[7].Value = hist.UserName;
        }
Beispiel #13
0
        private void AddItemToGrid(clsLoadWalletTransaction hist)
        {
            clsLoadAccount load   = clsLoadAccount.GetLoadAccount(hist.Load_Id);
            int            rowidx = dgvTrans.Rows.Add();

            dgvTrans.Rows[rowidx].Cells[0].Value = hist.Timestamp;
            dgvTrans.Rows[rowidx].Cells[1].Value = load.Description;
            dgvTrans.Rows[rowidx].Cells[2].Value = hist.MobileNum;
            dgvTrans.Rows[rowidx].Cells[3].Value = hist.LoadAmount;
            dgvTrans.Rows[rowidx].Cells[4].Value = hist.DiscountPercentage;
            dgvTrans.Rows[rowidx].Cells[5].Value = hist.AmtDue;

            dgvTrans.Rows[rowidx].Cells[6].Value = hist.Username;
        }
Beispiel #14
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);
                }
            }
        }
Beispiel #15
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                clsEloadTransaction eload = new clsEloadTransaction();
                eload.Load_Id            = m_LoadAccount.LoadId;
                eload.Timestamp          = DateTime.Now;
                eload.AmountDue          = double.Parse(txtAmtDue.Text.Trim());
                eload.Rebate             = double.Parse(txtRebate.Text.Trim());
                eload.Transaction_Amount = double.Parse(txtTransAmount.Text);
                eload.MobileNum          = txtMobile.Text;
                eload.ELoadName          = cmbLoadAmt.Text;
                eload.UserId             = myPosWide.m_user.UserId;
                eload.Remarks            = cmbLoadAmt.Text;
                frmInput input     = new frmInput();
                double   amountdue = eload.AmountDue;
                input.Title   = "Payment";
                input.Value   = amountdue.ToString("0.00");
                input.Caption = "Enter Tendered Amount";

                if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (Convert.ToDouble(input.Value) >= amountdue)
                    {
                        eload.TenderedAmount = Convert.ToDouble(input.Value);
                        if (eload.Save())
                        {
                            Clear();
                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            eload.PrintReceipt();
                            RefreshAccount();
                        }
                        else
                        {
                            MessageBox.Show("Transaction not saved.", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Amount entered is less than the Amount Due", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }
Beispiel #16
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);
                        }
                    }
                }
            }
        }
Beispiel #17
0
 public frmClaimECash(clsLoadAccount account)
 {
     InitializeComponent();
     m_LoadAccount = account;
     ctrlLoadAccount1.Description = m_LoadAccount.Description;
     ctrlLoadAccount1.LoadType    = m_LoadAccount.LoadType;
     ctrlLoadAccount1.LoadId      = m_LoadAccount.LoadId;
     //btn.Picture =
     if (m_LoadAccount.ImgFile != null)
     {
         MemoryStream mem = new MemoryStream(m_LoadAccount.ImgFile);
         ctrlLoadAccount1.Picture = Image.FromStream(mem);
         mem.Close();
     }
     else
     {
         ctrlLoadAccount1.Picture = null;
     }
 }
Beispiel #18
0
 private void RefreshAccount()
 {
     m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
     m_LoadAccount.LstServiceFees = clsServiceFee.GetServiceFees(m_LoadAccount.LoadId);
     ctrlLoadAccount.Description  = m_LoadAccount.Description;
     ctrlLoadAccount.LoadType     = m_LoadAccount.LoadType;
     ctrlLoadAccount.LoadId       = m_LoadAccount.LoadId;
     lblAvailableBal.Text         = string.Format("Available Bal: {0:n}\nCurrent Bal: {1:n}", m_LoadAccount.AvailableBalance, m_LoadAccount.CurrentBalance);
     //btn.Picture =
     if (m_LoadAccount.ImgFile != null)
     {
         MemoryStream mem = new MemoryStream(m_LoadAccount.ImgFile);
         ctrlLoadAccount.Picture = Image.FromStream(mem);
         mem.Close();
     }
     else
     {
         ctrlLoadAccount.Picture = null;
     }
 }
Beispiel #19
0
        private void btnReload_Click(object sender, EventArgs e)
        {
            if (!clsUtil.GetApproval(m_user, UserAccess.Manager))
            {
                return;
            }
            clsLoadAccount selact = GetSelAccount();

            if (selact != null)
            {
                frmReloadAccount reload = new frmReloadAccount(selact, m_user);
                if (reload.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    ReloadAccounts();
                }
            }
            else
            {
                MessageBox.Show("No Account Selected", "Reload", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #20
0
 private void UpdateFields(clsLoadAccount act)
 {
     if (act != null)
     {
         cboLoadType.SelectedIndex = (int)act.LoadType;
         txtAccountNum.Text        = act.AccountNum;
         txtMobile.Text            = act.MobileNum;
         txtDesc.Text     = act.Description;
         txtCurBal.Text   = act.CurrentBalance.ToString("0.00");
         txtAvailBal.Text = act.AvailableBalance.ToString("0.00");
         ImageData        = act.ImgFile;
         if (ImageData != null)
         {
             MemoryStream mem = new MemoryStream(ImageData);
             picImage.Image = Image.FromStream(mem);
             mem.Close();
         }
         else
         {
             picImage.Image = null;
         }
     }
 }
Beispiel #21
0
        private ctrlLoadAccount CreateButton(clsLoadAccount a)
        {
            ctrlLoadAccount btn = new ctrlLoadAccount();

            btn.Name        = "btn" + a.MobileNum;
            btn.Description = a.Description;
            btn.LoadType    = a.LoadType;
            btn.LoadId      = a.LoadId;
            //btn.Picture =
            if (a.ImgFile != null)
            {
                MemoryStream mem = new MemoryStream(a.ImgFile);
                btn.Picture = Image.FromStream(mem);
                mem.Close();
            }
            else
            {
                btn.Picture = null;
            }

            btn.OnClick += new ctrlLoadAccount.OnClickHandler(LoadAccount_Click);
            return(btn);
        }
Beispiel #22
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (!clsUtil.GetApproval(m_user, UserAccess.Supervisor))
     {
         return;
     }
     if (ValidateFields())
     {
         clsLoadAccount m_loadaccount = GetSelAccount();
         if (m_loadaccount == null)
         {
             m_loadaccount        = new clsLoadAccount();
             m_loadaccount.LoadId = 0;
         }
         m_loadaccount.AccountNum       = txtAccountNum.Text.Trim();
         m_loadaccount.AvailableBalance = Convert.ToDouble(txtAvailBal.Text);
         m_loadaccount.CurrentBalance   = Convert.ToDouble(txtCurBal.Text);
         m_loadaccount.Description      = txtDesc.Text.Trim();
         m_loadaccount.ImgFile          = ImageData;
         m_loadaccount.LoadType         = clsLoadAccount.GetLoadType(cboLoadType.Text);
         m_loadaccount.MobileNum        = txtMobile.Text.Trim();
         if (!m_loadaccount.Save())
         {
             MessageBox.Show("Load Account Not Saved!", "Save Account", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             ClearFields();
             ReloadAccounts();
             btnNew.PerformClick();
         }
     }
     else
     {
         MessageBox.Show("Please fillout necessary field(s).", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #23
0
 public frmLoadWalletTrans(clsLoadAccount act)
 {
     InitializeComponent();
     m_LoadAccount = clsLoadAccount.GetLoadAccount(act.LoadId);
 }
Beispiel #24
0
        private void btnProcessSend_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                clsSmartCashTransaction sc = new clsSmartCashTransaction();
                sc.TransDate       = DateTime.Now;
                sc.SenderName      = txtSenderName.Text.Trim();
                sc.SenderContact   = txtSenderNum.Text.Trim();
                sc.Load_Id         = m_LoadAccount.LoadId;
                sc.Remarks         = " ";
                sc.RecepientAccNum = " ";
                sc.UserId          = myPosWide.m_user.UserId;
                if (tabCtrl.SelectedIndex == 0)
                {
                    sc.TransType        = SCashTranstype.SEND;
                    sc.RecipientName    = txtSSRecipientName.Text.Trim();
                    sc.RecipientContact = txtSSRecipientNum.Text.Trim();
                    sc.RecepientAccNum  = txtSSSmartMoney.Text.Trim();

                    sc.RefNum       = txtSSRefNum.Text;
                    sc.TransAmount  = double.Parse(txtSSAmount.Text.Trim());
                    sc.SvcFeeAmount = double.Parse(txtSSSvcFee.Text.Trim());
                    sc.Rebate       = double.Parse(txtSSCommission.Text.Trim());
                    sc.Remarks      = clsSmartCashTransaction.GetTransType(sc.TransType);
                    frmInput input     = new frmInput();
                    double   amountdue = sc.TransAmount + sc.SvcFeeAmount;
                    input.Title   = "Payment";
                    input.Value   = amountdue.ToString("0.00");
                    input.Caption = "Enter Tendered Amount";
                    if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (Convert.ToDouble(input.Value) >= amountdue)
                        {
                            sc.TenderedAmount = Convert.ToDouble(input.Value);
                            if (sc.Save())
                            {
                                string  ret = "";
                                Receipt or  = new Receipt();
                                or.InitializePrinter();
                                List <string> strmsg = new List <string>();
                                ret += or.PrintCompanyHeader();
                                strmsg.Add("SMART MONEY");
                                strmsg.Add(sc.Remarks);
                                ret += or.PrintHeader(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold);
                                strmsg.Clear();

                                strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                                strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                                strmsg.Add(string.Format("TransId: {0}", sc.SCashTransId));
                                strmsg.Add("");
                                strmsg.Add(string.Format("Sender: {0:0.00}", sc.SenderName));
                                strmsg.Add(string.Format("Contact Num: {0:0.00}", sc.SenderContact));
                                strmsg.Add(string.Format("Recipient: {0:0.00}", sc.RecipientName));
                                strmsg.Add(string.Format("Contact: {0:0.00}", sc.RecipientContact));
                                strmsg.Add(string.Format("Smart Money: {0:0.00}", sc.RecepientAccNum));
                                strmsg.Add(string.Format("RefNum: {0:0.00}", sc.RefNum));
                                strmsg.Add(string.Format("Trans Amount: P {0:0.00}", sc.TransAmount));
                                strmsg.Add(string.Format("Service Fee: P {0:0.00}", sc.SvcFeeAmount));
                                strmsg.Add(string.Format("Total Amount: P {0:0.00}", amountdue));
                                strmsg.Add(string.Format("Tendered Amount: P {0:0.00}", sc.TenderedAmount));
                                strmsg.Add(string.Format("Change Amount: P {0:0.00}", sc.TenderedAmount - amountdue));
                                strmsg.Add("");
                                strmsg.Add("");
                                ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                                or.FormFeed();
                                or.OpenDrawer();
                                or.ExecPrint(ret);
                                strmsg.Clear();
                                Clear();
                                m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                                RefreshAccount();
                            }
                            else
                            {
                                MessageBox.Show("Saving failed", "Save", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Amount entered is less than the Amount Due", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                else if (tabCtrl.SelectedIndex == 1)
                {
                    sc.TransType = SCashTranstype.ENCASH;
                    if (optCash.Checked)
                    {
                        sc.PaymentMode = SCashPaymentMode.CASH;
                    }
                    else if (optSmartMoney.Checked)
                    {
                        sc.PaymentMode = SCashPaymentMode.SMARTMONEY;
                    }

                    sc.SenderAccnum       = txtCSSmartMoney.Text;
                    sc.RefNum             = txtCSRefNum.Text;
                    sc.TransAmount        = double.Parse(txtCSAmount.Text.Trim());
                    sc.SvcFeeAmount       = double.Parse(txtCSSvcFee.Text.Trim());
                    sc.Rebate             = 0; // double.Parse(txtCSCommission.Text.Trim());
                    sc.TotalAmtTransfered = double.Parse(txtCSTotalAmtTrans.Text);


                    if (MessageBox.Show(string.Format("You are about to deduct {0:0.00} from your actual cash on hand.\n\nAre you sure this is correct?", sc.TransAmount - sc.SvcFeeAmount), "Payment", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (sc.Save())
                        {
                            if (clsUnclaimedCash.ClaimCash(sc.RefNum))
                            {
                                UpdateList();
                            }
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("SMART MONEY");
                            strmsg.Add(sc.Remarks);
                            ret += or.PrintHeader(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold);
                            strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", sc.SCashTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("Sender: {0:0.00}", sc.SenderName));
                            strmsg.Add(string.Format("Contact Num: {0:0.00}", sc.SenderContact));
                            strmsg.Add(string.Format("Smart Money: {0:0.00}", sc.RecepientAccNum));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", sc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", sc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", sc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", sc.TransAmount - sc.SvcFeeAmount));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();
                            Clear();
                            RefreshAccount();
                        }
                    }
                }
            }
        }
Beispiel #25
0
 public frmGCashTrans(clsLoadAccount act)
 {
     InitializeComponent();
     txtAmount.TextChanged += new EventHandler(textBox_TextChanged);
     m_LoadAccount          = act;
 }
Beispiel #26
0
 public frmELoadTrans(clsLoadAccount act)
 {
     InitializeComponent();
     m_LoadAccount = clsLoadAccount.GetLoadAccount(act.LoadId);
     m_LoadAccount.LstServiceFees = clsServiceFee.GetServiceFees(m_LoadAccount.LoadId);
 }
Beispiel #27
0
        private void btnProcessGCash_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                double amountdue = 0;

                clsGCashTransaction gc = new clsGCashTransaction();
                gc.SenderName       = txtSenderName.Text;
                gc.SenderContact    = txtSenderNum.Text;
                gc.RecipientName    = txtRecipientName.Text;
                gc.RecipientContact = txtRecipientNum.Text;
                gc.GCashNumber      = txtGCashMobNum.Text;
                gc.TransDate        = DateTime.Now;
                gc.Country          = "";

                if (tabCtrl.SelectedIndex == 0)
                {
                    if (optCashIn.Checked)
                    {
                        gc.TransactionType = GCashTransType.CashIn;
                    }
                    else if (optCashOut.Checked)
                    {
                        gc.TransactionType = GCashTransType.CashOut;
                    }
                    else if (optSendOthers.Checked)
                    {
                        gc.TransactionType = GCashTransType.SendToOthers;
                    }

                    gc.RefNum       = txtRefNum1.Text;
                    gc.TransAmount  = Convert.ToDouble(txtAmount1.Text);
                    gc.SvcFeeAmount = Convert.ToDouble(txtSvcFee1.Text);
                    gc.Rebate       = Convert.ToDouble(txtRebate1.Text);
                }
                else if (tabCtrl.SelectedIndex == 1)
                {
                    if (optRecInt.Checked)
                    {
                        gc.TransactionType = GCashTransType.IntCashPickUp;
                        gc.Country         = txtCountry.Text;
                    }
                    else if (optRecDom.Checked)
                    {
                        gc.TransactionType = GCashTransType.DomCashPickup;
                    }

                    gc.RefNum       = txtRefNum2.Text;
                    gc.TransAmount  = Convert.ToDouble(txtAmount2.Text);
                    gc.SvcFeeAmount = Convert.ToDouble(txtSvcFee2.Text);
                    gc.Rebate       = Convert.ToDouble(txtRebate2.Text);
                }
                else if (tabCtrl.SelectedIndex == 2)
                {
                    if (optSendP2P.Checked)
                    {
                        gc.TransactionType = GCashTransType.RemitSend;
                        gc.TransAmount     = Convert.ToDouble(txtAmount3.Text);
                        gc.SvcFeeAmount    = Convert.ToDouble(txtSvcFee3.Text);
                        gc.Rebate          = Convert.ToDouble(txtRebate3.Text);
                    }
                    else if (optCancelP2P.Checked)
                    {
                        gc.TransactionType = GCashTransType.RemitCancel;
                        gc.TransAmount     = Convert.ToDouble(txtAmount3.Text);
                        gc.SvcFeeAmount    = Convert.ToDouble(txtSvcFee3.Text);
                        gc.Rebate          = Convert.ToDouble(txtRebate3.Text);
                    }
                    gc.RefNum = "";
                }
                amountdue   = gc.TransAmount + gc.SvcFeeAmount;
                gc.UserId   = myPosWide.m_user.UserId;
                gc.UserName = myPosWide.m_user.UserName;
                gc.Remarks  = clsGCashTransaction.GetTransType(gc.TransactionType);
                gc.Load_Id  = m_LoadAccount.LoadId;

                if (tabCtrl.SelectedIndex == 2 && optCancelP2P.Checked)
                {
                    amountdue = gc.SvcFeeAmount;
                    if (MessageBox.Show(string.Format("Amount: {0:0.00}\nService Fee: {1:0.00}\nPayout Amount: {2:0.00}\n\nAre you sure this is correct?", gc.TransAmount, gc.SvcFeeAmount, gc.TransAmount - gc.SvcFeeAmount), "Cancel Remittance", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (gc.Save())
                        {
                            MessageBox.Show("Transaction completed", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold);
                            strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("{0}", gc.Remarks));
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recipient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", gc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", gc.TransAmount - gc.SvcFeeAmount));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();

                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                    }
                }
                else if (tabCtrl.SelectedIndex == 0 && optCashOut.Checked)
                {
                    amountdue = gc.SvcFeeAmount;
                    if (MessageBox.Show(string.Format("Amount: {0:0.00}\nService Fee: {1:0.00}\nPayout Amount: {2:0.00}\n\nAre you sure this is correct?", gc.TransAmount, gc.SvcFeeAmount, gc.TransAmount - gc.SvcFeeAmount), "Cash Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (gc.Save())
                        {
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold); strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("{0}", gc.Remarks));
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recipient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", gc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", gc.TransAmount - gc.SvcFeeAmount));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();

                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                    }
                }
                else if (tabCtrl.SelectedIndex == 1)
                {
                    if (MessageBox.Show(string.Format("You are about to deduct {0:0.00} from your actual cash on hand. \n\nAre you sure this is correct?", gc.TransAmount), "Receive Remittance", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (gc.Save())
                        {
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold); strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recipient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", gc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", gc.TransAmount - gc.SvcFeeAmount));
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();

                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                    }
                }
                else
                {
                    frmInput input = new frmInput();
                    input.Title   = "Payment";
                    input.Value   = amountdue.ToString("0.00");
                    input.Caption = "Enter Tendered Amount";
                    if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (Convert.ToDouble(input.Value) >= amountdue)
                        {
                            gc.TenderedAmount = Convert.ToDouble(input.Value);
                            gc.Save();
                            MessageBox.Show("Transaction completed", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("");
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold); strmsg.Clear();
                            strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recepient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("Recepient Number: {0:0.00}", gc.RecipientContact));

                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Tendered Amount: P {0:0.00}", gc.TenderedAmount));
                            strmsg.Add(string.Format("Change: P {0:0.00}", gc.TenderedAmount - (gc.TransAmount + gc.SvcFeeAmount)));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();


                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                        else
                        {
                            MessageBox.Show("Amount entered is less than the Amount Due", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Kindly fill-out required fields", "Process", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #28
0
 public frmGlobeGCashTrans(clsLoadAccount act)
 {
     InitializeComponent();
     m_LoadAccount = clsLoadAccount.GetLoadAccount(act.LoadId);
 }
Beispiel #29
0
 public frmSubDAccounts(clsLoadAccount act)
 {
     InitializeComponent();
     this.m_LoadAccount = act;
 }
Beispiel #30
0
 public frmServiceFee(clsLoadAccount act)
 {
     InitializeComponent();
     this.m_LoadAccount = act;
 }