private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle); if (r != null) { if (myCategoryID == 1 || myCategoryID == 3 || myCategoryID == 4 || myCategoryID == 5 || myCategoryID == 6 || myCategoryID == 14 || myCategoryID == 23) { myPOS.NewReceiptEntry(r["strPackageCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mListPrice"]), ""); } else if (myCategoryID == 2) { if (lkpEdtBankCode.Text.Length == 0) { MessageBox.Show(this, "Please select a Bank Code"); this.DialogResult = DialogResult.None; return; } else if (lkpEdtBankBranchCode.Text.Length == 0) { MessageBox.Show(this, "Please select a Bank Branch Code"); this.DialogResult = DialogResult.None; return; } else if (txtEdtAccNo.Text.Length == 0) { MessageBox.Show(this, "Please key in the Account No"); this.DialogResult = DialogResult.None; return; } // myPOS.NewReceiptEntry(r["strPackageCode"].ToString(), // -1, r["strDescription"].ToString(), // 3, ACMS.Convert.ToDecimal(r["mListPrice"]), "", // lkpEdtBankCode.Text, lkpEdtBankBranchCode.Text, txtEdtAccNo.Text); } else if (myCategoryID == 7) { myPOS.NewReceiptEntry(r["strCreditPackageCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mListPrice"]), ""); } 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"]), ""); } } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle); if (r != null) { string strCode = r["nLockerNo"].ToString(); //ACMSDAL.TblBranch sqlBranch = new ACMSDAL.TblBranch(); //sqlBranch.StrBranchCode = myPOS.StrBranchCode; //sqlBranch.SelectOne(); string strSQL; DataSet _ds; _ds = new DataSet(); strSQL = "select MLockerDepositRate,MLockerRentalRate1,MLockerRentalRate2 from tblLockerRate where strBranchCode='" + myPOS.StrBranchCode + "' and nLockerNo=" + r["nLockerNo"].ToString(); SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); decimal rate1 = ACMS.Convert.ToDecimal(_ds.Tables["Table"].Rows[0]["MLockerRentalRate1"]); decimal rate2 = ACMS.Convert.ToDecimal(_ds.Tables["Table"].Rows[0]["MLockerRentalRate2"]); //decimal rate1 = ACMS.Convert.ToDecimal(sqlBranch.MLockerRentalRate1); //decimal rate2 = ACMS.Convert.ToDecimal(sqlBranch.MLockerRentalRate2); decimal finalRate = rate1; int monthtoRent = (int)calcEdit1.Value; if (monthtoRent <= 0) { MessageBox.Show(this, "Invalid Number of Month(s)"); this.DialogResult = DialogResult.None; return; } if (monthtoRent >= 3) { finalRate = rate2; } myPOS.NewReceiptEntry(strCode, -1, string.Format("New Locker Rented, Locker ID : {0}", strCode), monthtoRent, finalRate, strCode); //decimal lockerDeposit = ACMS.Convert.ToDecimal(sqlBranch.MLockerDepositRate); decimal lockerDeposit = ACMS.Convert.ToDecimal(_ds.Tables["Table"].Rows[0]["MLockerDepositRate"]); myPOS.NewReceiptEntry(strCode, -1, "Locker Deposit", 1, lockerDeposit, strCode); } if (myPOS.ReceiptItemsTable.Rows.Count == 0) { myPOS.POSLockerAction = ACMSLogic.POS.LockerAction.None; } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = GridView7.GetDataRow(GridView7.FocusedRowHandle); if (r != null) { ACMS.ACMSPOS2.FormGetService frm = new FormGetService(StrPackageCode); DialogResult result = frm.ShowDialog(this); if (result == DialogResult.OK) { decimal unitPrice = frm.BasePrice - PackageBaseUnitPrice; if (unitPrice < 0) { unitPrice = 0; } myPOS.NewReceiptEntry(frm.StrServiceCode, -1, "Top Up Single Treatment For Member Package : " + NPackageID.ToString(), 1, unitPrice, NPackageID.ToString()); this.Close(); } else { this.DialogResult = DialogResult.None; return; } } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { decimal paymentAmt = 0; DataRow r = GridView11.GetDataRow(GridView11.FocusedRowHandle); if (System.Convert.ToInt32(lkeTopUp.EditValue) > 0 && r != null) { try { decimal dCreditDiscount = System.Convert.ToDecimal(r["dCreditDiscount"]); paymentAmt = ACMS.Convert.ToDecimal(txtEdtTotalAmt.Text.Replace("$", "")); //ACMS.Convert.ToDecimal(lkeTopUp.EditValue) / 100 * (100 - dCreditDiscount) - ACMS.Convert.ToDecimal(r["Balance"]); myPOS.NewReceiptEntry(r["nCreditPackageID"].ToString(), -1, string.Format("Top Up Credit Package ID : {0}", r["nCreditPackageID"].ToString()), 1, paymentAmt, r["strCreditPackageCode"].ToString()); } catch (Exception) { MessageBox.Show(this, "Invalid Top Up amount."); this.DialogResult = DialogResult.None; return; } } else { MessageBox.Show(this, "Invalid Top Up amount."); this.DialogResult = DialogResult.None; return; } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle); if (r != null) { if (r["Status"].ToString() == "Exceed Grace Period") { MessageBox.Show(this, "The locker have exceeded the grace period! She can only extend the locker."); return; } ACMSDAL.TblReceiptEntries sqlReceiptEntries = new ACMSDAL.TblReceiptEntries(); DataTable table = sqlReceiptEntries.GetLockerDepositBaseStrReceiptNo_N_NLockerNO(r["strReceiptNo"].ToString(), r["nLockerNo"].ToString()); decimal lockerDeposit = ACMS.Convert.ToDecimal(table.Rows[0]["MSubTotal"]); myPOS.NewReceiptEntry(r["nLockerNo"].ToString(), -1, "Return Locker", 1, -lockerDeposit, r["nLockerNo"].ToString()); this.Close(); } if (myPOS.ReceiptItemsTable.Rows.Count == 0) { myPOS.POSLockerAction = ACMSLogic.POS.LockerAction.None; } }
private void sBtnNew_ForgetCardDeposit_Click(object sender, System.EventArgs e) { if (myPOS.NCategoryID == 17) { if (myPOS.ReceiptItemsTable.Rows.Count > 0 || myPOS.POSForgetCardAction == ACMSLogic.POS.ForgetCardAction.Refund) { MessageBox.Show(this, "Only One item is allow for Forget Card Deposit per receipt."); return; } // ACMSDAL.TblReceipt sqlReceipt = new ACMSDAL.TblReceipt(); // DataTable receipttable = sqlReceipt.GetToDayForgetCardReceipt(myPOS.StrMembershipID, myPOS.NCategoryID); // // if (receipttable != null && receipttable.Rows.Count > 0) // { // MessageBox.Show(this, "You have paid the forget card deposit today."); // return; // } ACMSDAL.TblCompany comp = new ACMSDAL.TblCompany(); DataTable compTable = comp.SelectAll(); decimal forgetCardRate = ACMS.Convert.ToDecimal(compTable.Rows[0]["mForgetCardRate"]); myPOS.NewReceiptEntry(myPOS.StrMembershipID, -1, "Forget Card", 1, forgetCardRate, myPOS.StrMembershipID); myPOS.POSForgetCardAction = ACMSLogic.POS.ForgetCardAction.ForgetCard; this.Close(); } }
//private void panelControlPackage_Paint(object sender, System.Windows.Forms.PaintEventArgs e) //{ //} private void simpleButton3_Click(object sender, System.EventArgs e) { DataRow r = gridViewMemberPackage.GetDataRow(gridViewMemberPackage.FocusedRowHandle); if (r != null) { //insert an giro package ID to the myPos myPOS.NExtendGIROpkg = ACMS.Convert.ToInt32(r["nPackageID"]); //decimal mUnitPrice = myPOS.NCategoryID == 2 ? 128m : 118m; if (myPOS.NCategoryID == 35 && r["strPackageCode"].ToString().Contains("GIRO(fit)")) { myPOS.NCategoryID = 2; } else { myPOS.NCategoryID = 35; } decimal mUnitPrice = myPOS.NCategoryID == 34 ? 118m:ACMS.Convert.ToInt32(r["mListPrice"]); string strReceiptDesc = myPOS.NCategoryID == 34 ? "Extend SPA GIRO package":"Extend Member GIRO package"; //decimal mUnitPrice = myPOS.NCategoryID == 2 ? ACMS.Convert.ToInt32(r["mListPrice"]) : 118m; //string strReceiptDesc = myPOS.NCategoryID == 2 ? "Extend Member GIRO package" : "Extend SPA GIRO package"; myPOS.NewReceiptEntry(r["nPackageID"].ToString(), myPOS.NCategoryID, strReceiptDesc, 1, mUnitPrice, ""); } }
private void btnOK_Click(object sender, System.EventArgs e) { if (dtProrateTo.Value.Day == 15 || dtProrateTo.Value.Day == DateTime.DaysInMonth(dtProrateTo.Value.Year, dtProrateTo.Value.Month) || dtProrateTo.Value.Day == 1 || dtProrateTo.Value.Day == 16) { decimal mBasePrice = 118; TimeSpan ProRateDays = dtProrateTo.Value - dtProrateFrom.Value; int ProDiff = ACMS.Convert.ToInt32(Math.Round(ProRateDays.TotalDays + 1, 0).ToString()); decimal ProdateRate = ACMS.Convert.ToDecimal(ProDiff) / ACMS.Convert.ToDecimal(DateTime.DaysInMonth(dtProrateTo.Value.Year, dtProrateTo.Value.Month)); decimal ProrateTotal; if (dtProrateFrom.Value.Day == 1 || dtProrateTo.Value.Day == 16) { ProrateTotal = (2 * mBasePrice); } else { ProrateTotal = 2 * mBasePrice + Math.Round(mBasePrice * ProdateRate, 2); } lbl2.Text = "$" + ProrateTotal; string strTypeCard = ""; //myPOS.dtPackageStart is changed to dtProrateTo as expired date should count on To myPOS.dtPackageStart = dtProrateFrom.Value; myPOS.NProrateDays = ProDiff; myPOS.NewReceiptEntry("GIRO(fit)", -1, "GIRO FItness", 1, ProrateTotal, "", txtCardHolder.Text, strTypeCard, txtCreditCardNo.Text, dtCardExpiry.Value); } else { MessageBox.Show(" Please select the date either 15th or end of the month "); return; } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle); if (r != null) { string strCode = r["nLockerNo"].ToString(); ACMSDAL.TblBranch sqlBranch = new ACMSDAL.TblBranch(); sqlBranch.StrBranchCode = myPOS.StrBranchCode; sqlBranch.SelectOne(); decimal rate1 = ACMS.Convert.ToDecimal(sqlBranch.MLockerRentalRate1); decimal rate2 = ACMS.Convert.ToDecimal(sqlBranch.MLockerRentalRate2); decimal finalRate = rate1; int monthtoRent = (int)calcEdit1.Value; if (monthtoRent <= 0) { MessageBox.Show(this, "Invalid Number of Month(s)"); this.DialogResult = DialogResult.None; return; } if (monthtoRent >= 3) { finalRate = rate2; } myPOS.NewReceiptEntry(strCode, -1, string.Format("New Locker Rented, Locker ID : {0}", strCode), monthtoRent, finalRate, strCode); decimal lockerDeposit = ACMS.Convert.ToDecimal(sqlBranch.MLockerDepositRate); myPOS.NewReceiptEntry(strCode, -1, "Locker Deposit", 1, lockerDeposit, strCode); } if (myPOS.ReceiptItemsTable.Rows.Count == 0) { myPOS.POSLockerAction = ACMSLogic.POS.LockerAction.None; } }
private void simpleButton3_Click(object sender, System.EventArgs e) { DataRow r = gridViewMemberPackage.GetDataRow(gridViewMemberPackage.FocusedRowHandle); if (r != null) { //insert an giro package ID to the myPos myPOS.NExtendGIROpkg = ACMS.Convert.ToInt32(r["nPackageID"]); myPOS.NewReceiptEntry(r["nPackageID"].ToString(), 2, "Extend Member GIRO package", 1, 118, ""); //myMemberPackage.UpdateMemberGIRO(ACMS.Convert.ToInt32(r["nPackageID"])); } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow [] selectedRows = myDataTable.Select("fSelected = true", "", DataViewRowState.CurrentRows); if (selectedRows.Length == 0) { MessageBox.Show(this, "Please select a forget card receipt that you want to refund.", "Warning"); this.DialogResult = DialogResult.None; return; } foreach (DataRow row in selectedRows) { myPOS.NewReceiptEntry(row["strReceiptNo"].ToString(), -1, string.Format("Forget Card Refund - Receipt No : {0}", row["strReceiptNo"].ToString()), 1, -ACMS.Convert.ToDecimal(row["mNettAmount"]), DateTime.Today.Date.ToString("yyyy/MM/dd")); } myPOS.POSForgetCardAction = ACMSLogic.POS.ForgetCardAction.Refund; }
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"]), ""); } } }
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. "); } } } }