Example #1
0
        private bool isValuesAssigned()
        {
            bool boRetValue = false;

            try { Convert.ToDecimal(txtAmount.Text); }
            catch
            {
                MessageBox.Show("Sorry, the amount you entered is not valid. Please check the amount you entered.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(boRetValue);
            }

            if (Convert.ToDecimal(txtAmount.Text) > 0)
            {
                mclsPaidOutDetails.Amount        = Convert.ToDecimal(txtAmount.Text);
                mclsPaidOutDetails.PaymentType   = (PaymentTypes)Enum.Parse(typeof(PaymentTypes), cboType.Text, true);
                mclsPaidOutDetails.Remarks       = txtRemarks.Text;
                mclsPaidOutDetails.DateCreated   = DateTime.Now;
                mclsPaidOutDetails.TerminalNo    = CompanyDetails.TerminalNo;
                mclsPaidOutDetails.BranchDetails = mclsTerminalDetails.BranchDetails;
                mclsPaidOutDetails.CashierID     = mCashierID;

                // boRetValue = true;
                // 15Apr2015 No need to check for this coz Disburse is based on actual cash.

                Data.CashierReports clsCashierReport  = new Data.CashierReports();
                Data.TerminalReport clsTerminalReport = new Data.TerminalReport(clsCashierReport.Connection, clsCashierReport.Transaction);
                clsTerminalReport.SyncTransactionSales(mclsTerminalDetails.BranchDetails.BranchID, mclsTerminalDetails.TerminalNo);
                if (!clsCashierReport.IsPaidOutAmountValid(mclsPaidOutDetails))
                {
                    MessageBox.Show("Sorry, the amount you entered is greater than the " + cboType.Text + " sales." +
                                    "Please check the amount you entered.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    boRetValue = true;
                }
                clsCashierReport.CommitAndDispose();
            }
            else
            {
                MessageBox.Show("Sorry, amount must be greater than zero." +
                                "Please enter amount that is greater than zero.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return(boRetValue);
        }
Example #2
0
        private bool isValuesAssigned()
        {
            bool boRetValue = false;

            try { Convert.ToDecimal(txtAmount.Text); }
            catch
            {
                MessageBox.Show("Sorry, the amount you entered is not valid. Please check the amount you entered.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return boRetValue;
            }

            if (Convert.ToDecimal(txtAmount.Text) > 0)
            {
                mclsPaidOutDetails.Amount = Convert.ToDecimal(txtAmount.Text);
                mclsPaidOutDetails.PaymentType = (PaymentTypes)Enum.Parse(typeof(PaymentTypes), cboType.Text, true);
                mclsPaidOutDetails.Remarks = txtRemarks.Text;
                mclsPaidOutDetails.DateCreated = DateTime.Now;
                mclsPaidOutDetails.TerminalNo = CompanyDetails.TerminalNo;
                mclsPaidOutDetails.BranchDetails = mclsTerminalDetails.BranchDetails;
                mclsPaidOutDetails.CashierID = mCashierID;

                // boRetValue = true;
                // 15Apr2015 No need to check for this coz Disburse is based on actual cash.

                Data.CashierReports clsCashierReport = new Data.CashierReports();
                Data.TerminalReport clsTerminalReport = new Data.TerminalReport(clsCashierReport.Connection, clsCashierReport.Transaction);
                clsTerminalReport.SyncTransactionSales(mclsTerminalDetails.BranchDetails.BranchID, mclsTerminalDetails.TerminalNo);
                if (!clsCashierReport.IsPaidOutAmountValid(mclsPaidOutDetails))
                {
                    MessageBox.Show("Sorry, the amount you entered is greater than the " + cboType.Text + " sales." +
                        "Please check the amount you entered.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    boRetValue = true;
                }
                clsCashierReport.CommitAndDispose();
            }
            else
            {
                MessageBox.Show("Sorry, amount must be greater than zero." +
                    "Please enter amount that is greater than zero.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return boRetValue;
        }