private void sBtn_ForgetCardRefund_Click(object sender, System.EventArgs e) { if (myPOS.NCategoryID == 17) { if (myPOS.POSForgetCardAction == ACMSLogic.POS.ForgetCardAction.ForgetCard) { MessageBox.Show(this, "This receipt is for Forget Card Deposit. \n You are not allow to tender forget card deposit and forget card refund under one receipt."); return; } // New Forget Card Refund FormForgetCardReceiptSelection frm = new FormForgetCardReceiptSelection(myPOS); try { frm.ShowDialog(this); } finally { if (frm != null) { if (!frm.IsDisposed) { frm.Dispose(); } } } #region COmment // if (myPOS.ReceiptItemsTable.Rows.Count > 0) // { // MessageBox.Show(this, "Only One item is allow for Forget Card Refund per receipt."); // return; // } // // ACMSDAL.TblClassAttendance classAttendance = new ACMSDAL.TblClassAttendance(); // DataTable forgetCardClassTable = classAttendance.GetForgetCardClassAttendance(myPOS.StrMembershipID); // // if (forgetCardClassTable != null && forgetCardClassTable.Rows.Count > 0) // { // DataTable dateTable = new DataTable(); // DataColumn coldate = new DataColumn("Date", typeof(string)); // dateTable.Columns.Add(coldate); // // foreach (DataRow r in forgetCardClassTable.Rows) // { // DateTime forgetCarddate = ACMS.Convert.ToDateTime(r["dtDate"]); // // DataRow[] rowList = dateTable.Select("Date = '" + forgetCarddate.ToString("ddMMyyyy")+ "'"); // // if (rowList.Length == 0) // { // DataRow newRow = dateTable.NewRow(); // newRow["Date"] = ACMS.Convert.ToDateTime(r["dtDate"]).ToString("ddMMyyyy"); // dateTable.Rows.Add(newRow); // } // else // { // r.Delete(); // } // } // // forgetCardClassTable.AcceptChanges(); // // ACMSDAL.TblReceipt sqlReceipt = new ACMSDAL.TblReceipt(); // DataTable table = new DataTable(); // // foreach (DataRow r in forgetCardClassTable.Rows) // { // DateTime dtDate = ACMS.Convert.ToDateTime(r["dtDate"]); // // DataTable tempTable = sqlReceipt.GetForgetCardReceipt(myPOS.StrMembershipID, 17, dtDate); // // if (tempTable.Rows.Count > 0) // { // if (table.Rows.Count > 0) // { // foreach (DataRow tempRow in tempTable.Rows) // table.ImportRow(tempRow); // // } // else // { // table = tempTable.Copy(); // } // } // } // // decimal mUnitPrice = 0; // string forgotCardReceiptNo = ""; // // foreach (DataRow r in table.Rows) // { // forgotCardReceiptNo += r["strReceiptNo"].ToString() + ","; // mUnitPrice += ACMS.Convert.ToDecimal(r["mNettAmount"]); // } // // myPOS.NewReceiptEntry(myPOS.StrMembershipID, -1, "Forget Card Refund", // 1, -mUnitPrice, forgotCardReceiptNo); // // } // else // { // MessageBox.Show(this, "No Forget Card Receipt to refund."); // return; // } #endregion } }