private void simpleButtonOK_Click(object sender, System.EventArgs e)
        {
            myDataRow["strReferenceNo"] = txtEdtRefNo.Text;

            int nPromotionTypeID = -1;

            if (lkpEdtItemFreebiePromotionCode.EditValue != null && lkpEdtItemFreebiePromotionCode.Text.Length > 0)
            {
                nPromotionTypeID = (int)lkpEdtItemFreebiePromotionCode.GetColumnValue("nPromotionTypeID");
            }

            if (nPromotionTypeID == -1 && lkpEdtDiscount.EditValue != null && lkpEdtDiscount.Text.Length > 0)
            {
                myPOS.EditItemFreebieAndDiscount(myDataRow, null, "", lkpEdtDiscount.Text, true);
            }
            else if (nPromotionTypeID == 1)
            {
                // free Product
                ACMS.XtraUtils.GridViewUtils.UpdateData(gridView2);
                if (gridControl2.DataSource != null)
                {
                    DataRow[] rowList = ((DataTable)gridControl2.DataSource).Select("Checked = true");

                    if (rowList.Length == 0)
                    {
                        MessageBox.Show(this, "Please select a product.");
                        this.DialogResult = DialogResult.None;
                        return;
                    }
                    myPOS.EditItemFreebieAndDiscount(myDataRow, rowList, lkpEdtItemFreebiePromotionCode.Text, lkpEdtDiscount.Text, false);
                }
            }
            else
            {
                ACMS.XtraUtils.GridViewUtils.UpdateData(gridView1);

                if (gridControl1.DataSource != null)
                {
                    DataRow[] rowList = ((DataTable)gridControl1.DataSource).Select("Checked = true");

                    if (rowList.Length == 0)
                    {
                        MessageBox.Show(this, "Please select a package.");
                        this.DialogResult = DialogResult.None;
                        return;
                    }
                    myPOS.EditItemFreebieAndDiscount(myDataRow, rowList, lkpEdtItemFreebiePromotionCode.Text, lkpEdtDiscount.Text, true);
                }
            }
        }
        private void simpleButtonOK_Click(object sender, System.EventArgs e)
        {
            ValidatePackageQty();

            myDataRow["strReferenceNo"] = txtEdtRefNo.Text;

            int nPromotionTypeID = -1;

            if (lkpEdtItemFreebiePromotionCode.EditValue != null && lkpEdtItemFreebiePromotionCode.Text.Length > 0)
            {
                nPromotionTypeID = (int)lkpEdtItemFreebiePromotionCode.GetColumnValue("nPromotionTypeID");
            }

            if (nPromotionTypeID == -1 && lkpEdtDiscount.EditValue != null && lkpEdtDiscount.Text.Length > 0)
            {
                myPOS.EditItemFreebieAndDiscount(myDataRow, null, "", lkpEdtDiscount.Text, true);
            }
            //else
            if (nPromotionTypeID == 1)
            {
                // free Product
                ACMS.XtraUtils.GridViewUtils.UpdateData(gridView2);
                if (gridControl2.DataSource != null)
                {
                    DataRow[] rowList = ((DataTable)gridControl2.DataSource).Select("Checked = true");

                    if (rowList.Length == 0)
                    {
                        MessageBox.Show(this, "Please select a product.");
                        this.DialogResult = DialogResult.None;
                        return;
                    }
                    else
                    {
                        if (!myIsFinishLoadStockRecon)
                        {
                            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
                            connection       = new SqlConnection(connectionString);

                            // StartProgressBar

                            BackgroundWorker bw = new BackgroundWorker();
                            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
                            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

                            m_fmProgress = new fmProgress();
                            bw.RunWorkerAsync();
                            m_fmProgress.ShowDialog(this);
                            m_fmProgress = null;

                            //StartProgressBar
                            myIsFinishLoadStockRecon = true;
                        }

                        myPOS.EditItemFreebieAndDiscount(myDataRow, rowList, lkpEdtItemFreebiePromotionCode.Text, lkpEdtDiscount.Text, false);
                    }
                }
            }
            ValidateFreebieQty();

            {
                ACMS.XtraUtils.GridViewUtils.UpdateData(gridView1);

                if (gridControl1.DataSource != null)
                {
                    DataRow[] rowList = ((DataTable)gridControl1.DataSource).Select("Checked = true");

                    myPOS.EditItemFreebieAndDiscount(myDataRow, rowList, lkpEdtItemFreebiePromotionCode.Text, lkpEdtDiscount.Text, true);
                }
            }
        }
Esempio n. 3
0
        private void simpleButtonOK_Click(object sender, System.EventArgs e)
        {
            DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle);

            if (r != null)
            {
                ACMSDAL.TblMemberPackage sqlCalcAnyOS1 = new ACMSDAL.TblMemberPackage();
                decimal dOutAmount = sqlCalcAnyOS1.OutstandingAmount(myPOS.StrMembershipID);

                if (myPOS.ReceiptMasterTable.Rows[0]["nCategoryID"].ToString() == "9")
                {
                    if (myPOS.ReceiptItemsTable.Select("strCode='" + r["strPackageGroupCode"].ToString() + "'").Length > 0)
                    {
                        MessageBox.Show(this, r["strPackageGroupCode"].ToString() + " already selected!", "Warning");
                        return;
                    }
                }

                if (dOutAmount > 0)
                {
                    DialogResult result1 = MessageBox.Show(this, myPOS.ReceiptMasterTable.Rows[0]["strMemberName"] + " has Outstanding amount of " + (string.Format("{0:C}", dOutAmount)) + "\nDo you want to continue?", "Warning",
                                                           MessageBoxButtons.YesNo);

                    if (result1 == DialogResult.No)
                    {
                        return;
                    }
                }

                if (myCategoryID == 4)
                {
                    //2106
                    TblMember sqlMember = new TblMember();
                    if (sqlMember.MembershipThisMonthBirtdayForUtilised(myPOS.StrMembershipID))
                    {
                        DialogResult result1 = MessageBox.Show("Member is having birthday this months and having 50% discount. Do you want to utilies?", "Warning",
                                                               MessageBoxButtons.YesNo);

                        if (result1 == DialogResult.Yes)
                        {
                            myPOS.NewBillDiscount("120046SSD");
                            myPOS.NewReceiptEntry(r["strPackageCode"].ToString(),
                                                  -1, r["strDescription"].ToString(),
                                                  1, (ACMS.Convert.ToDecimal(r["mListPrice"])), "");
                        }
                        else
                        {
                            myPOS.NewReceiptEntry(r["strPackageCode"].ToString(),
                                                  -1, r["strDescription"].ToString(),
                                                  1, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                        }
                    }
                    else
                    {
                        myPOS.NewReceiptEntry(r["strPackageCode"].ToString(),
                                              -1, r["strDescription"].ToString(),
                                              1, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                    }
                }
                // END TEST

                if (myCategoryID == 1 || myCategoryID == 3 ||                // myCategoryID == 4 ||
                    myCategoryID == 6 || myCategoryID == 14 ||
                    myCategoryID == 23)
                {
                    myPOS.NewReceiptEntry(r["strPackageCode"].ToString(),
                                          -1, r["strDescription"].ToString(),
                                          1, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                }
                else if (myCategoryID == 5)
                {
                    myPOS.NewReceiptEntry(r["strPackageCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                    DataTable myTblspapacakge = myPOSHelper.SearchOnePackageCode(r["strPackageCode"].ToString());

                    if (myTblspapacakge.Rows[0]["strFreePkgCode"].ToString() != string.Empty)
                    {
                        // ACMSLogic.POSEntries myEntry = new ACMSLogic.POSEntries(r);
                        myPOS.EditItemFreebieAndDiscount(myTblspapacakge.Rows[0]["strFreePkgCode"].ToString());
                    }
                }
                else if (myCategoryID == 2)
                {
                    decimal  mBasePrice      = 0M;
                    decimal  mProRateTotal   = 0M;
                    string   strTypeCard     = string.Empty;
                    string   strCode         = string.Empty;
                    string   strDesc         = string.Empty;
                    string   strCardHolder   = txtCardHolder.Text.Trim();
                    string   strCreditCardNo = txtCreditCardNo.Text.Trim();
                    string   strRefNo        = string.Empty;
                    DateTime dtFrom          = dtProrateFrom.Value;

                    mBasePrice           = ACMS.Convert.ToDecimal(r["mListPrice"]);
                    mProRateTotal        = (2 * mBasePrice);
                    strCode              = r["strPackageCode"].ToString();
                    strDesc              = r["strDescription"].ToString();
                    lblAmount.Text       = "$" + mProRateTotal.ToString();
                    myPOS.dtPackageStart = dtFrom;
                    if (dtProrateFrom.Value.Day != 1 && dtProrateFrom.Value.Day != 16)
                    {
                        MessageBox.Show(" Please select the date either 1st or 16th of the month ");
                        this.DialogResult = DialogResult.None;
                        return;
                    }

                    {
                        myPOS.NewReceiptEntry(strCode, -1, strDesc, 1, mProRateTotal, strRefNo, strCardHolder, strTypeCard, strCreditCardNo);
                    }
                }
                else if (myCategoryID == 7 || myCategoryID == 36 || myCategoryID == 37)
                {
                    myPOS.NewReceiptEntry(r["strCreditPackageCode"].ToString(),
                                          -1, r["strDescription"].ToString(),
                                          1, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                }
                else if (myCategoryID == 38)
                {
                    myPOS.NewReceiptEntry(r["strSN"].ToString(),
                                          -1, r["strDescription"].ToString(),
                                          1, ACMS.Convert.ToDecimal(r["mValue"]), "");
                }
                else if (myCategoryID == 8 || myCategoryID == 9)
                {
                    myPOS.NewReceiptEntry(r["strPackageGroupCode"].ToString(),
                                          -1, r["strDescription"].ToString(),
                                          1, ACMS.Convert.ToDecimal(r["mListPrice"]), "");
                }
                else if (myCategoryID == 11 || myCategoryID == 12)
                {
                    myPOS.NewReceiptEntry(r["strProductCode"].ToString(),
                                          -1, r["strDescription"].ToString(),
                                          1, ACMS.Convert.ToDecimal(r["mBaseUnitPrice"]), "");
                }
            }
        }
Esempio n. 4
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            if (ValidateGIRODate())//2504
            {
                decimal  mBasePrice      = 0M;
                decimal  mProRateTotal   = 0M;
                string   strTypeCard     = string.Empty;
                string   strCode         = string.Empty;
                string   strDesc         = string.Empty;
                string   strCardHolder   = txtCardHolder.Text.Trim();
                string   strCreditCardNo = txtCreditCardNo.Text.Trim();
                string   strRefNo        = string.Empty;
                DateTime dtFrom          = dtProrateFrom.Value;

                switch (myCategoryID)
                {
                case 2:
                    mBasePrice    = 128M;
                    mProRateTotal = (2 * mBasePrice);
                    strCode       = "GIRO(fit)";
                    strDesc       = "GIRO Fitness";
                    break;


                case 34:
                    mBasePrice    = 118M;
                    mProRateTotal = (2 * mBasePrice);
                    strCode       = "GIRO(spa)";
                    strDesc       = "GIRO Spa";
                    break;
                }

                lbl2.Text            = "$" + mProRateTotal.ToString();
                myPOS.dtPackageStart = dtFrom;
                myPOS.NewReceiptEntry(strCode, -1, strDesc, 1, mProRateTotal, strRefNo, strCardHolder, strTypeCard, strCreditCardNo);

                ///2504
                // ACMSPOS2.FormAddCreditPackage form = new ACMS.ACMSPOS2.FormAddCreditPackage(myPOS);
                //  form.ShowDialog(this);
                ////

                if (myCategoryID == 34)
                {
                    DataTable myTblspapacakge = myPOSHelper.SearchOnePackageCode(strCode);
                    if (myTblspapacakge != null)
                    {
                        if (myTblspapacakge.Rows.Count > 0)
                        {
                            DataRow dr = myTblspapacakge.Rows[0];

                            if (dr["strFreePkgCode"].ToString() != string.Empty)
                            {
                                myPOS.EditItemFreebieAndDiscount(dr["strFreePkgCode"].ToString());
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show(" Unable to retrieve member package table. ");
                    }
                }
            }
        }