Beispiel #1
0
        public GIROpkg(ACMSLogic.POS pos)
        {
            //public FormPayOutstanding(ACMSLogic.POS pos)
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myPOS = pos;
            myDataTable = new DataTable();
            myCategoryID = myPOS.NCategoryID;
            myPOSHelper= new ACMSLogic.POSHelper(myPOS);
        }
Beispiel #2
0
        public GIROpkg(ACMSLogic.POS pos)
        {
            //public FormPayOutstanding(ACMSLogic.POS pos)
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myPOS        = pos;
            myDataTable  = new DataTable();
            myCategoryID = myPOS.NCategoryID;
            myPOSHelper  = new ACMSLogic.POSHelper(myPOS);
        }
        public FormForgetCardReceiptSelection(ACMSLogic.POS pos)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myPOS = pos;
            myPOSHelper = new ACMSLogic.POSHelper(myPOS);
            myDataTable = myPOSHelper.GetDataTable();

            Init();
        }
Beispiel #4
0
        public FormForgetCardReceiptSelection(ACMSLogic.POS pos)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myPOS       = pos;
            myPOSHelper = new ACMSLogic.POSHelper(myPOS);
            myDataTable = myPOSHelper.GetDataTable();

            Init();
        }
Beispiel #5
0
        public FormAddCreditPackage(ACMSLogic.POS pos)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection       = new SqlConnection(connectionString);
            myPOS            = pos;
            myDataTable      = new DataTable();
            myCategoryID     = myPOS.NCategoryID;
            myPOSHelper      = new ACMSLogic.POSHelper(myPOS);
            Init();
        }
        public FormAddCreditPackage(ACMSLogic.POS pos)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection = new SqlConnection(connectionString);
            myPOS = pos;
            myDataTable = new DataTable();
            myCategoryID = myPOS.NCategoryID;
            myPOSHelper= new ACMSLogic.POSHelper(myPOS);
            Init();
        }
Beispiel #7
0
        private void btnEnter_Click(object sender, System.EventArgs e)
        {
            ACMSLogic.POSHelper helper = new ACMSLogic.POSHelper(myPOS);

            DataTable table = null;

            if (myPOS.NCategoryID == 11 || myPOS.NCategoryID == 12)
                table = helper.SearchOneProductCode(txtScannedCode.Text);
            else if (myPOS.NCategoryID == 1 || myPOS.NCategoryID == 2 || myPOS.NCategoryID == 3 ||
                myPOS.NCategoryID == 4 || myPOS.NCategoryID == 5 || myPOS.NCategoryID == 6 ||
                myPOS.NCategoryID == 8 || myPOS.NCategoryID == 7 || myPOS.NCategoryID == 9 )
            {
                table = helper.SearchOnePackageCode(txtScannedCode.Text);
            }

            if (table != null && table.Rows.Count == 1)
            {
                DataRow r = table.Rows[0];
                int qty = ACMS.Convert.ToInt32(calcEditQty.Value);

                if (myPOS.NCategoryID == 11 || myPOS.NCategoryID == 12)
                {
                    myPOS.NewReceiptEntry(r["strProductCode"].ToString(),
                        myPOS.StaffPurchaseCategoryID, r["strDescription"].ToString(),
                        qty, ACMS.Convert.ToDecimal(r["mBaseUnitPrice"]), "");
                }
                else if (myPOS.NCategoryID == 1 || myPOS.NCategoryID == 3 || myPOS.NCategoryID == 2 ||
                    myPOS.NCategoryID == 4 || myPOS.NCategoryID == 5 || myPOS.NCategoryID == 6)
                {
                    myPOS.NewReceiptEntry(r["strPackageCode"].ToString(),
                        myPOS.StaffPurchaseCategoryID, r["strDescription"].ToString(),
                        qty, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                }
                if (myPOS.NCategoryID == 7)
                {
                    myPOS.NewReceiptEntry(r["strCreditPackageCode"].ToString(),
                        myPOS.StaffPurchaseCategoryID, r["strDescription"].ToString(),
                        qty, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                }
                if (myPOS.NCategoryID == 8 || myPOS.NCategoryID == 9)
                {
                    myPOS.NewReceiptEntry(r["strPackageGroupCode"].ToString(),
                        myPOS.StaffPurchaseCategoryID, r["strDescription"].ToString(),
                        qty, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                }

                txtScannedCode.Text = "";
                txtScannedCode.Focus();
            }
            else
            {
                MessageBox.Show(this, "Cant Find any product.");
                txtScannedCode.Text = "";
                txtScannedCode.Focus();
            }
        }
Beispiel #8
0
        private void OnAddMineralWater()
        {
            if (myPOS.ReceiptItemsTable.Rows.Count > 0)
            {
                DialogResult result = MessageBox.Show(this,
                    "Only one item is allow. Do you want to overwrite the existing one?", "Warning", MessageBoxButtons.YesNo);

                if (result == DialogResult.No)
                    return;
                else
                    myPOS.ReceiptItemsTable.Rows.Clear();
            }

            ACMSLogic.POSHelper posHelper= new ACMSLogic.POSHelper(myPOS);
            DataTable table = posHelper.GetDataTable();

            if (table.Rows.Count > 0)
            {
                DataRow row = table.Rows[0];

                ACMS.ACMSPOS2.FormMineralWaterClosingDayCount frm = new ACMS.ACMSPOS2.FormMineralWaterClosingDayCount();

                if (frm.ShowDialog(this) == DialogResult.OK)
                {

                    //TblProductInventory productInventory = new TblProductInventory();
                    DataSet _ds;
                    _ds = new DataSet();
                    DataTable productInventorytable;
                    SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "dw_sp_SCStockReconItem", _ds, new string[] { "Table" }, new SqlParameter("@BranchCode", myPOS.StrBranchCode), new SqlParameter("@strProductCode", "MW"));
                    //DataTable productInventorytable = productInventory.GetProductQty(row["strProductCode"].ToString(), myPOS.StrBranchCode);
                    productInventorytable = _ds.Tables["Table"];

                    if (productInventorytable.Rows.Count > 0)
                    {
                        int initialQty = ACMS.Convert.ToInt32(productInventorytable.Rows[0]["nQty"]);

                        if (frm.Qty > initialQty)
                        {
                            //MessageBox.Show(this, "Please Open a carton (hint: Menu > Tools > Open A Carton)");
                            MessageBox.Show(this, "Qty entered is more than current stock balance");
                            return;
                        }
                        else if (initialQty > frm.Qty)
                        {
                            int diff = initialQty - frm.Qty;
                            decimal mineralWaterUnitPrice = ACMS.Convert.ToDecimal(row["mBaseUnitPrice"]);
                            decimal totalSales = decimal.Round(diff * mineralWaterUnitPrice, 2);

                            ACMSLogic.POSEntries posEntry = myPOS.NewReceiptEntry(row["strProductCode"].ToString(), -1, "Mineral Water Sales", diff, mineralWaterUnitPrice, "");
                            posEntry.POSEntryRow["MineralWaterQty"] = diff;
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "No Mineral Water in the branch.");
                    }
                }
            }
            else
            {
                MessageBox.Show(this, "No Mineral Water in the branch.");
            }
        }
Beispiel #9
0
        private void OnAddCashVoucher()
        {
            ACMS.ACMSPOS2.FormCashVoucher frm = new ACMS.ACMSPOS2.FormCashVoucher();
            myPOS.NQty = frm.Qty;
            ACMSLogic.POSHelper posHelper = new ACMSLogic.POSHelper(myPOS);
            DataTable table = posHelper.GetDataTable();

            if (table.Rows.Count > 0)
            {
                //DataRow row = table.Rows[0];

                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    string cmdText;
                    DataSet _ds;
                    _ds = new DataSet();
                    DataTable cvTable;

                    cmdText = "Select top " + frm.Qty.ToString() + " * from tblCashVoucher where strbranchcode=@strBranchCode and nTerminalID=@nTerminalID and fsell=1 and nstatusid=0 ORDER BY strSN ";
                    SqlHelper.FillDataset(connection, CommandType.Text, cmdText, _ds, new string[] { "Table" }, new SqlParameter("@strBranchCode", myPOS.StrBranchCode), new SqlParameter("@nTerminalID", myPOS.NTerminalID));

                    cvTable = _ds.Tables["Table"];

                    foreach (DataRow row in cvTable.Rows)
                    {
                        //int diff = initialQty - frm.Qty;
                        //decimal mineralWaterUnitPrice = ACMS.Convert.ToDecimal(row["mBaseUnitPrice"]);
                        //decimal totalSales = decimal.Round(diff * mineralWaterUnitPrice, 2);

                        ACMSLogic.POSEntries posEntry = myPOS.NewReceiptEntry(row["strSN"].ToString(), 38, row["strDescription"].ToString(), 1, Convert.ToDecimal(row["mValue"]), "");
                    }
                }
            }
            else
            {
                MessageBox.Show(this, "No Cash Voucher available in the branch.");
            }
        }