private void simpleButtonOK_Click(object sender, System.EventArgs e) { if (lookUpEdit1.Text != "") { myPOS.NewBillDiscount(lookUpEdit1.EditValue.ToString()); } if (lookUpEdit2.Text != "") { myPOS.NewBillDeposit(lookUpEdit2.EditValue.ToString()); } }
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"]), ""); } } }