private void cboCardType_SelectedIndexChanged(object sender, EventArgs e) { if (cboCardType.Text == "No available cards to issue") { grpCardInfo.Visible = false; } else { Data.CardType clsCardType = new Data.CardType(); Data.CardTypeDetails clsCardTypeDetails = clsCardType.Details(cboCardType.Text); clsCardType.CommitAndDispose(); if (clsCardTypeDetails.CardTypeID == 0) { grpCardInfo.Visible = false; CardTypeDetails = new Data.CardTypeDetails(); } else { grpCardInfo.Visible = true; grpCardInfo.Text = cboCardType.Text + " Information"; lblCardTypeCode.Text = clsCardTypeDetails.CardTypeCode; lblFinanceCharge.Text = clsCardTypeDetails.CreditFinanceCharge.ToString("##0.#0"); lblPenaltyCharge.Text = clsCardTypeDetails.CreditLatePenaltyCharge.ToString("##0.#0"); lblMinimumPercentageDue.Text = clsCardTypeDetails.CreditMinimumPercentageDue.ToString("##0.#0"); lblMinimumAmountDue.Text = clsCardTypeDetails.CreditMinimumAmountDue.ToString("##0.#0"); lblFinanceCharge15th.Text = clsCardTypeDetails.CreditFinanceCharge15th.ToString("##0.#0"); lblPenaltyCharge15th.Text = clsCardTypeDetails.CreditLatePenaltyCharge15th.ToString("##0.#0"); lblMinimumPercentageDue15th.Text = clsCardTypeDetails.CreditMinimumPercentageDue15th.ToString("##0.#0"); lblMinimumAmountDue15th.Text = clsCardTypeDetails.CreditMinimumAmountDue15th.ToString("##0.#0"); chkWithGuarantor.Checked = clsCardTypeDetails.WithGuarantor; CardTypeDetails = clsCardTypeDetails; if (!clsCardTypeDetails.WithGuarantor) { groupBox1.Height = 248; grpCardInfo.Height = 125; //this height should hide the 15th charges //mclsGuarantor = new Data.ContactDetails(); } else { groupBox1.Height = 300; grpCardInfo.Height = 180; } } } }
private void InsertCreditCardPayment(Data.Payment pvtclsPayment, long pvtlngTransactionID, string pvtstrTransactionNo, decimal pvtdecAmount, Int16 pvtintCardTypeID, string pvtstrCardNo, string pvtstrCardHolder, string pvtstrValidityDates, string pvtstrRemarks) { Data.CardType clsCardType = new Data.CardType(pvtclsPayment.Connection, pvtclsPayment.Transaction); Data.CardTypeDetails clsCardTypeDetails = clsCardType.Details(pvtintCardTypeID); Data.CreditCardPaymentDetails Details = new Data.CreditCardPaymentDetails(); Details.TransactionID = pvtlngTransactionID; Details.TransactionNo = pvtstrTransactionNo; Details.Amount = pvtdecAmount; Details.CardTypeID = pvtintCardTypeID; Details.CardNo = pvtstrCardNo; Details.CardTypeCode = clsCardTypeDetails.CardTypeCode; Details.CardTypeName = clsCardTypeDetails.CardTypeName; Details.CardHolder = pvtstrCardHolder; Details.ValidityDates = pvtstrValidityDates; Details.Remarks = pvtstrRemarks; pvtclsPayment.InsertCreditCardPayment(Details); pvtclsPayment.UpdateCredit(mclsCustomerDetails.ContactID, pvtlngTransactionID, pvtstrTransactionNo, pvtdecAmount, pvtstrRemarks); }
private void cboCardType_SelectedIndexChanged(object sender, EventArgs e) { if (cboCardType.Text == "No available cards to issue") { grpCardInfo.Visible = false; } else { Data.CardType clsCardType = new Data.CardType(); Data.CardTypeDetails clsCardTypeDetails = clsCardType.Details(cboCardType.Text); clsCardType.CommitAndDispose(); if (clsCardTypeDetails.CardTypeID == 0) { grpCardInfo.Visible = false; CardTypeDetails = new Data.CardTypeDetails(); } else { grpCardInfo.Visible = true; lblCardTypeCode.Text = clsCardTypeDetails.CardTypeCode; lblFinanceCharge.Text = clsCardTypeDetails.CreditFinanceCharge.ToString("##0.#0"); lblPenaltyCharge.Text = clsCardTypeDetails.CreditLatePenaltyCharge.ToString("##0.#0"); lblMinimumPercentageDue.Text = clsCardTypeDetails.CreditMinimumPercentageDue.ToString("##0.#0"); lblMinimumAmountDue.Text = clsCardTypeDetails.CreditMinimumAmountDue.ToString("##0.#0"); chkWithGuarantor.Checked = clsCardTypeDetails.WithGuarantor; CardTypeDetails = clsCardTypeDetails; if (!clsCardTypeDetails.WithGuarantor) { mclsGuarantor = new Data.ContactDetails(); } else { } } } }
private void InsertCreditCardPayment(Data.Payment clsPayment, Int64 intTransactionID, string strTransactionNo, decimal decAmount, Int16 intCardTypeID, string strCardNo, string strCardHolder, string strValidityDates, string strRemarks) { Data.CardType clsCardType = new Data.CardType(clsPayment.Connection, clsPayment.Transaction); Data.CardTypeDetails clsCardTypeDetails = clsCardType.Details(intCardTypeID); Data.CreditCardPaymentDetails Details = new Data.CreditCardPaymentDetails(); Details.BranchDetails = mclsTerminalDetails.BranchDetails; Details.TerminalNo = mclsTerminalDetails.TerminalNo; Details.TransactionID = intTransactionID; Details.TransactionNo = strTransactionNo; Details.Amount = decAmount; Details.CardTypeID = intCardTypeID; Details.CardNo = strCardNo; Details.CardTypeCode = clsCardTypeDetails.CardTypeCode; Details.CardTypeName = clsCardTypeDetails.CardTypeName; Details.CardHolder = strCardHolder; Details.ValidityDates = strValidityDates; Details.Remarks = strRemarks; new Data.CreditCardPayments(clsPayment.Connection, clsPayment.Transaction).Insert(Details); clsPayment.UpdateCredit(mclsCustomerDetails.ContactID, intTransactionID, strTransactionNo, decAmount, strRemarks); }
private bool isValuesAssigned() { decimal mdecAmount = 0; try { mdecAmount = Convert.ToDecimal(txtAmount.Text); } catch { txtAmount.Focus(); MessageBox.Show("Sorry you have entered an invalid amount for credit card payment." + "Please type a valid credit amount.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } if (txtCardNo.Text == null || txtCardNo.Text == "") { txtCardNo.Focus(); MessageBox.Show("Please type a valid Card No.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } if (txtCardHolder.Text == null || txtCardHolder.Text == "") { txtCardHolder.Focus(); MessageBox.Show("Please type a valid Card Holder.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } DateTime ValidityDate = DateTime.MinValue; if (txtValidityDates.Text == null || txtValidityDates.Text == "") { txtValidityDates.Focus(); MessageBox.Show("Please type a valid Validity Date.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } else if (txtValidityDates.Text != null && txtValidityDates.Text != "") { try { string Month = txtValidityDates.Text.Substring(0, 2); string Year = "20" + txtValidityDates.Text.Substring(2, 2); string Day = DateTime.DaysInMonth(Convert.ToInt32(Year), Convert.ToInt32(Month)).ToString(); ValidityDate = new DateTime(int.Parse(Year), int.Parse(Month), int.Parse(Day)); } catch { txtValidityDates.Focus(); MessageBox.Show("Please type a valid Validity Date. Format must be mmyy", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } if (ValidityDate < DateTime.Now) { txtValidityDates.Focus(); MessageBox.Show("Card has been expired, please ask for a valid credit card.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } } Data.CardType clsCardType = new Data.CardType(); Data.CardTypeDetails cardtypedetails = clsCardType.Details(cboCardType.Text); clsCardType.CommitAndDispose(); mDetails.BranchDetails = mclsTerminalDetails.BranchDetails; mDetails.TerminalNo = mclsTerminalDetails.TerminalNo; mDetails.TransactionID = mclsSalesTransactionDetails.TransactionID; mDetails.TransactionNo = mclsSalesTransactionDetails.TransactionNo; mDetails.Amount = mdecAmount; mDetails.CardTypeID = cardtypedetails.CardTypeID; mDetails.CardTypeCode = cardtypedetails.CardTypeCode; mDetails.CardTypeName = cardtypedetails.CardTypeName; mDetails.CardNo = txtCardNo.Text; mDetails.CardHolder = txtCardHolder.Text; mDetails.ValidityDates = ValidityDate.ToString("MMddyy"); mDetails.Remarks = txtRemarks.Text; return(true); }
/// <summary> /// This is to print the Internal Credit Card used for payment /// </summary> /// <param name="clsChargeSlipType"></param> public void PrintChargeSlip(ChargeSlipType clsChargeSlipType) { try { decimal decInternalCreditCardPayment = 0; Data.ContactDetails clsCreditorDetails = new Data.ContactDetails(); Data.ContactDetails clsGuarantorDetails = new Data.ContactDetails(); Data.CardTypeDetails clsCreditCardTypeDetails = new Data.CardTypeDetails(); foreach (Data.CreditCardPaymentDetails clsCreditCardPaymentDetails in mclsSalesTransactionDetails.PaymentDetails.arrCreditCardPaymentDetails) { if (clsCreditCardPaymentDetails.CardTypeDetails.CreditCardType == CreditCardTypes.Internal) { decInternalCreditCardPayment += clsCreditCardPaymentDetails.Amount; clsCreditCardTypeDetails = clsCreditCardPaymentDetails.CardTypeDetails; clsCreditorDetails = clsCreditCardPaymentDetails.CreditorDetails; Data.Contacts clsContacts = new Data.Contacts(mConnection, mTransaction); mConnection = clsContacts.Connection; mTransaction = clsContacts.Transaction; if (clsCreditCardTypeDetails.WithGuarantor) { clsGuarantorDetails = new Data.Contacts(mConnection, mTransaction).Details(clsCreditorDetails.CreditDetails.GuarantorID); } clsContacts.CommitAndDispose(); } } if (decInternalCreditCardPayment != 0) { PrintingPreference oldCONFIG_AutoPrint = mclsTerminalDetails.AutoPrint; mclsTerminalDetails.AutoPrint = PrintingPreference.Normal; PrintReportHeaderSection(false, DateTime.MinValue); if (!string.IsNullOrEmpty(mclsSysConfigDetails.ChargeSlipHeaderLabel)) { msbToPrint.Append(CenterString(mclsSysConfigDetails.ChargeSlipHeaderLabel, mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); msbToPrint.Append(CenterString(Constants.C_FE_NOT_VALID_AS_RECEIPT, mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); } msbToPrint.Append(Environment.NewLine); msbToPrint.Append(Environment.NewLine); msbToPrint.Append("Trans. Date".PadRight(15) + ":" + mclsSalesTransactionDetails.TransactionDate.ToString("yyyy-MM-dd").PadLeft(mclsTerminalDetails.MaxReceiptWidth - 16) + Environment.NewLine); msbToPrint.Append("OR #".PadRight(15) + ":" + mclsSalesTransactionDetails.ORNo.PadLeft(mclsTerminalDetails.MaxReceiptWidth - 16) + Environment.NewLine); // print the guarantor if with guarantor if (clsCreditCardTypeDetails.WithGuarantor) { msbToPrint.Append(CenterString(clsGuarantorDetails.ContactCode, mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); msbToPrint.Append("-".PadLeft(mclsTerminalDetails.MaxReceiptWidth, '-') + Environment.NewLine); msbToPrint.Append(CenterString("Guarantor", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); } msbToPrint.Append(Environment.NewLine); // print the charge slip header if (string.IsNullOrEmpty(clsCreditCardTypeDetails.CardTypeName)) { msbToPrint.Append(CenterString("CHARGE SLIP", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); } else { msbToPrint.Append(CenterString(clsCreditCardTypeDetails.CardTypeName + " CHARGE SLIP", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); } // print the amount and agreement msbToPrint.Append(Environment.NewLine); msbToPrint.Append("Amount of Purchase".PadRight(18) + ":" + decInternalCreditCardPayment.ToString("#,##0.#0").PadLeft(mclsTerminalDetails.MaxReceiptWidth - 19) + Environment.NewLine); msbToPrint.Append(Environment.NewLine); if (mclsTerminalDetails.IncludeCreditChargeAgreement) { msbToPrint.Append("I hereby agree to pay the total amount" + Environment.NewLine); msbToPrint.Append("stated herein including any charges due" + Environment.NewLine); msbToPrint.Append("thereon subject to the pertinent" + Environment.NewLine); msbToPrint.Append("contract governing the use of this" + Environment.NewLine); msbToPrint.Append("Credit Card." + Environment.NewLine); msbToPrint.Append(Environment.NewLine); msbToPrint.Append(Environment.NewLine); } msbToPrint.Append("-".PadLeft(mclsTerminalDetails.MaxReceiptWidth, '-') + Environment.NewLine); msbToPrint.Append(CenterString(mclsSalesTransactionDetails.CustomerName, mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); msbToPrint.Append(Environment.NewLine); msbToPrint.Append(Environment.NewLine); msbToPrint.Append("-".PadLeft(mclsTerminalDetails.MaxReceiptWidth, '-') + Environment.NewLine); msbToPrint.Append(CenterString(mclsSalesTransactionDetails.CashierName, mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); msbToPrint.Append(CenterString("Cashier", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); msbToPrint.Append(Environment.NewLine); switch (clsChargeSlipType) { case ChargeSlipType.Customer: msbToPrint.Append(CenterString("Customer's Copy", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); break; case ChargeSlipType.Original: msbToPrint.Append(CenterString("Original Copy", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); break; case ChargeSlipType.Guarantor: msbToPrint.Append(CenterString("Guarantor's Copy", mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); break; } msbToPrint.Append(CenterString("Check Ctr:" + Int64.Parse(mclsSalesTransactionDetails.TransactionNo).ToString(), mclsTerminalDetails.MaxReceiptWidth) + Environment.NewLine); PrintPageAndReportFooterSection(false, DateTime.MinValue); mclsTerminalDetails.AutoPrint = oldCONFIG_AutoPrint; InsertAuditLog(AccessTypes.PrintTransactionHeader, "Print Charge Slip: " + clsChargeSlipType.ToString("G") + " TerminalNo=" + mclsTerminalDetails.TerminalNo + " @ Branch: " + mclsTerminalDetails.BranchDetails.BranchCode); } } catch (Exception ex) { InsertErrorLogToFile(ex, "ERROR!!! Printing Charge Slip: " + clsChargeSlipType.ToString("G")); } Cursor.Current = Cursors.Default; }
private void IssueCreditCard() { if (mboIsInTransaction) { MessageBox.Show("Sorry you cannot issue a Credit Card while there is an ongoing transaction. Please finish the transaction first.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DialogResult loginresult = GetWriteAccessAndLogin(mclsSalesTransactionDetails.CashierID, AccessTypes.CreditCardIssuance); if (loginresult == DialogResult.OK) { try { DialogResult result; Data.CardTypeDetails clsCardTypeDetails = new Data.CardTypeDetails(); Data.ContactDetails clsGuarantorDetails = new AceSoft.RetailPlus.Data.ContactDetails(); ContactCreditTypeSelectWnd clsContactCreditTypeSelectWnd = new ContactCreditTypeSelectWnd(); clsContactCreditTypeSelectWnd.TerminalDetails = mclsTerminalDetails; clsContactCreditTypeSelectWnd.ShowDialog(this); clsCardTypeDetails = clsContactCreditTypeSelectWnd.CardTypeDetails; result = clsContactCreditTypeSelectWnd.Result; clsContactCreditTypeSelectWnd.Close(); clsContactCreditTypeSelectWnd.Dispose(); if (result != DialogResult.OK) { return; } Data.ContactDetails clsContactDetails; ContactSelectWnd clsContactWnd = new ContactSelectWnd(); clsContactWnd.EnableContactAddUpdate = GetWriteAccess(mclsSalesTransactionDetails.CashierID, AccessTypes.Contacts) == System.Windows.Forms.DialogResult.OK; clsContactWnd.SysConfigDetails = mclsSysConfigDetails; clsContactWnd.TerminalDetails = mclsTerminalDetails; if (clsCardTypeDetails.WithGuarantor) { MessageBox.Show("Please select a GUARANTOR to issue Credit Card.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); clsContactWnd.ContactGroupCategory = AceSoft.RetailPlus.Data.ContactGroupCategory.CUSTOMER; clsContactWnd.Header = "Select GUARANTOR to issue Credit Card."; clsContactWnd.ShowDialog(this); clsGuarantorDetails = clsContactWnd.Details; result = clsContactWnd.Result; clsContactWnd.Close(); clsContactWnd.Dispose(); if (result != DialogResult.OK) { return; } MessageBox.Show(clsGuarantorDetails.ContactName + " has been selected as guarantor." + Environment.NewLine + "Please select the CUSTOMER to issue Credit Card.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); } clsContactWnd = new ContactSelectWnd(); clsContactWnd.EnableContactAddUpdate = GetWriteAccess(mclsSalesTransactionDetails.CashierID, AccessTypes.Contacts) == System.Windows.Forms.DialogResult.OK; clsContactWnd.SysConfigDetails = mclsSysConfigDetails; clsContactWnd.TerminalDetails = mclsTerminalDetails; clsContactWnd.ContactGroupCategory = AceSoft.RetailPlus.Data.ContactGroupCategory.CUSTOMER; clsContactWnd.Header = "Select CUSTOMER to issue Credit Card."; clsContactWnd.ShowDialog(this); clsContactDetails = clsContactWnd.Details; result = clsContactWnd.Result; clsContactWnd.Close(); clsContactWnd.Dispose(); if (result != DialogResult.OK) { return; } if (clsContactDetails.ContactID == Constants.ZERO || clsContactDetails.ContactID == Constants.C_RETAILPLUS_CUSTOMERID) { return; } // if no guarantor if (!clsCardTypeDetails.WithGuarantor) clsGuarantorDetails = new Data.ContactDetails(); clsEvent.AddEvent("[" + lblCashier.Text + "] Issuing credit card no to " + clsContactDetails.ContactName); Data.Contacts clsContact = new Data.Contacts(mConnection, mTransaction); mConnection = clsContact.Connection; mTransaction = clsContact.Transaction; clsContactDetails = clsContact.Details(clsContactDetails.ContactID); clsContact.CommitAndDispose(); if (clsContactDetails.CreditDetails.CreditCardNo != string.Empty && clsContactDetails.CreditDetails.CreditCardNo != null) { clsEvent.AddEventLn("Cancelled!"); clsEvent.AddEventLn("Credit Card No: " + clsContactDetails.CreditDetails.CreditCardNo + " was already issued to " + clsContactDetails.ContactName + " on " + clsContactDetails.CreditDetails.CreditAwardDate.ToString("MMM dd, yyyy hh:mm tt")); MessageBox.Show("Credit Card No: " + clsContactDetails.CreditDetails.CreditCardNo + " was already issued to " + clsContactDetails.ContactName + " on " + clsContactDetails.CreditDetails.CreditAwardDate.ToString("MMM dd, yyyy hh:mm tt") + "." + Environment.NewLine + " Please select another customer to issue Credit Card.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } clsEvent.AddEvent("[" + lblCashier.Text + "] Issuing credit card no to " + clsContactDetails.ContactName); ContactCreditWnd clsContactCreditWnd = new ContactCreditWnd(); clsContactCreditWnd.Header = "Credit Card Issuance"; clsContactCreditWnd.CardTypeDetails = clsCardTypeDetails; clsContactCreditWnd.Guarantor = clsGuarantorDetails; clsContactCreditWnd.ContactDetails = clsContactDetails; clsContactCreditWnd.CreditCardStatus = CreditCardStatus.New; clsContactCreditWnd.TerminalDetails = mclsTerminalDetails; clsContactCreditWnd.ShowDialog(this); result = clsContactCreditWnd.Result; clsContactDetails = clsContactCreditWnd.ContactDetails; clsContactCreditWnd.Close(); clsContactCreditWnd.Dispose(); if (result == DialogResult.OK) { Data.Products clsProducts = new Data.Products(mConnection, mTransaction); mConnection = clsProducts.Connection; mTransaction = clsProducts.Transaction; string strProductBarcode = Data.Products.DEFAULT_CREDIT_CARD_MEMBERSHIP_FEE_BARCODE; //override if with Guarantor if (clsCardTypeDetails.WithGuarantor) strProductBarcode = Data.Products.DEFAULT_SUPER_CARD_MEMBERSHIP_FEE_BARCODE; if (clsProducts.Details(strProductBarcode).ProductID == 0) { if (!clsCardTypeDetails.WithGuarantor) clsProducts.CREATE_CREDIT_CARD_MEMBERSHIP_FEE_BARCODE_PRODUCT(); else clsProducts.CREATE_SUPER_CARD_MEMBERSHIP_FEE_BARCODE_PRODUCT(); Methods.InsertAuditLog(mclsTerminalDetails, "System Administrator", AccessTypes.RewardCardChange, strProductBarcode + " product has been created coz it's not configured"); } clsProducts.CommitAndDispose(); MessageBox.Show("Credit Card No: " + clsContactDetails.CreditDetails.CreditCardNo + " was issued to " + clsContactDetails.ContactName + "." + Environment.NewLine + "Please collect the payment then close the transaction.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); clsEvent.AddEventLn("Done!", true); clsEvent.AddEventLn("Credit Card No: " + clsContactDetails.CreditDetails.CreditCardNo + " was issued to " + clsContactDetails.ContactName + ".", true); LocalDB clsLocalDB = new LocalDB(mConnection, mTransaction); mConnection = clsLocalDB.Connection; mTransaction = clsLocalDB.Transaction; clsEvent.AddEvent("[" + lblCashier.Text + "] Creating " + strProductBarcode + "transaction for customer: "); LoadContact(AceSoft.RetailPlus.Data.ContactGroupCategory.CUSTOMER, clsContactDetails); if (!this.CreateTransaction()) return; txtBarCode.Text = strProductBarcode; ReadBarCode(); int iRow = dgItems.CurrentRowIndex; txtBarCode.Text = ""; CloseTransaction(); clsLocalDB.CommitAndDispose(); } else { clsEvent.AddEventLn("Cancelled!"); } } catch (Exception ex) { InsertErrorLogToFile(ex, "ERROR!!! Issuing internal credit-card."); } Cursor.Current = Cursors.Default; } }
private void cboCardType_SelectedIndexChanged(object sender, EventArgs e) { Data.CardType clsCardType = new Data.CardType(); mclsCardTypeDetails = clsCardType.Details(cboCardType.Text); clsCardType.CommitAndDispose(); }
private void cboCardType_SelectedIndexChanged(object sender, EventArgs e) { if (cboCardType.Text == "No available cards to issue") grpCardInfo.Visible = false; else { Data.CardType clsCardType = new Data.CardType(); Data.CardTypeDetails clsCardTypeDetails = clsCardType.Details(cboCardType.Text); clsCardType.CommitAndDispose(); if (clsCardTypeDetails.CardTypeID == 0) { grpCardInfo.Visible = false; CardTypeDetails = new Data.CardTypeDetails(); } else { grpCardInfo.Visible = true; lblCardTypeCode.Text = clsCardTypeDetails.CardTypeCode; lblFinanceCharge.Text = clsCardTypeDetails.CreditFinanceCharge.ToString("##0.#0"); lblPenaltyCharge.Text = clsCardTypeDetails.CreditLatePenaltyCharge.ToString("##0.#0"); lblMinimumPercentageDue.Text = clsCardTypeDetails.CreditMinimumPercentageDue.ToString("##0.#0"); lblMinimumAmountDue.Text = clsCardTypeDetails.CreditMinimumAmountDue.ToString("##0.#0"); chkWithGuarantor.Checked = clsCardTypeDetails.WithGuarantor; CardTypeDetails = clsCardTypeDetails; if (!clsCardTypeDetails.WithGuarantor) { mclsGuarantor = new Data.ContactDetails(); } else { } } } }
private void cboCardType_SelectedIndexChanged(object sender, EventArgs e) { if (cboCardType.Text == "No available cards to issue") grpCardInfo.Visible = false; else { Data.CardType clsCardType = new Data.CardType(); Data.CardTypeDetails clsCardTypeDetails = clsCardType.Details(cboCardType.Text); clsCardType.CommitAndDispose(); if (clsCardTypeDetails.CardTypeID == 0) { grpCardInfo.Visible = false; CardTypeDetails = new Data.CardTypeDetails(); } else { grpCardInfo.Visible = true; grpCardInfo.Text = cboCardType.Text + " Information"; lblCardTypeCode.Text = clsCardTypeDetails.CardTypeCode; lblFinanceCharge.Text = clsCardTypeDetails.CreditFinanceCharge.ToString("##0.#0"); lblPenaltyCharge.Text = clsCardTypeDetails.CreditLatePenaltyCharge.ToString("##0.#0"); lblMinimumPercentageDue.Text = clsCardTypeDetails.CreditMinimumPercentageDue.ToString("##0.#0"); lblMinimumAmountDue.Text = clsCardTypeDetails.CreditMinimumAmountDue.ToString("##0.#0"); lblFinanceCharge15th.Text = clsCardTypeDetails.CreditFinanceCharge15th.ToString("##0.#0"); lblPenaltyCharge15th.Text = clsCardTypeDetails.CreditLatePenaltyCharge15th.ToString("##0.#0"); lblMinimumPercentageDue15th.Text = clsCardTypeDetails.CreditMinimumPercentageDue15th.ToString("##0.#0"); lblMinimumAmountDue15th.Text = clsCardTypeDetails.CreditMinimumAmountDue15th.ToString("##0.#0"); chkWithGuarantor.Checked = clsCardTypeDetails.WithGuarantor; CardTypeDetails = clsCardTypeDetails; if (!clsCardTypeDetails.WithGuarantor) { groupBox1.Height = 248; grpCardInfo.Height = 125; //this height should hide the 15th charges //mclsGuarantor = new Data.ContactDetails(); } else { groupBox1.Height = 300; grpCardInfo.Height = 180; } } } }