private void SaveCredit() { PaymentsCreditDetails clsDetails = new PaymentsCreditDetails(); clsDetails.PaymentID = Convert.ToInt64(lblPaymentID.Text); clsDetails.ChartOfAccountID = Convert.ToInt32(cboAccount.SelectedItem.Value); clsDetails.Amount = Convert.ToDecimal(txtAmount.Text); PaymentsCredit clsPaymentsCredit = new PaymentsCredit(); clsPaymentsCredit.Insert(clsDetails); clsPaymentsCredit.CommitAndDispose(); }
private void LoadItems() { long PaymentID = Convert.ToInt64(lblPaymentID.Text); DataClass clsDataClass = new DataClass(); PaymentsDebit clsPaymentsDebit = new PaymentsDebit(); lstPaymentsDebit.DataSource = clsDataClass.DataReaderToDataTable(clsPaymentsDebit.List(PaymentID, "PaymentDebitID", SortOption.Ascending)).DefaultView; lstPaymentsDebit.DataBind(); PaymentsCredit clsPaymentsCredit = new PaymentsCredit(clsPaymentsDebit.Connection, clsPaymentsDebit.Transaction); lstPaymentsCredit.DataSource = clsDataClass.DataReaderToDataTable(clsPaymentsCredit.List(PaymentID, "PaymentCreditID", SortOption.Ascending)).DefaultView; lstPaymentsCredit.DataBind(); clsPaymentsDebit.CommitAndDispose(); }
private bool DeleteItems() { bool boRetValueDebit = false; string stIDs = ""; foreach (DataListItem item in lstPaymentsDebit.Items) { HtmlInputCheckBox chkListDebit = (HtmlInputCheckBox)item.FindControl("chkListDebit"); if (chkListDebit != null) { if (chkListDebit.Checked == true) { stIDs += chkListDebit.Value + ","; boRetValueDebit = true; } } } if (boRetValueDebit) { PaymentsDebit clsPaymentsDebit = new PaymentsDebit(); clsPaymentsDebit.Delete(stIDs.Substring(0, stIDs.Length - 1)); clsPaymentsDebit.CommitAndDispose(); } bool boRetValueCredit = false; stIDs = ""; foreach (DataListItem item in lstPaymentsCredit.Items) { HtmlInputCheckBox chkListCredit = (HtmlInputCheckBox)item.FindControl("chkListCredit"); if (chkListCredit != null) { if (chkListCredit.Checked == true) { stIDs += chkListCredit.Value + ","; boRetValueCredit = true; } } } if (boRetValueCredit) { PaymentsCredit clsPaymentsCredit = new PaymentsCredit(); clsPaymentsCredit.Delete(stIDs.Substring(0, stIDs.Length - 1)); clsPaymentsCredit.CommitAndDispose(); } bool boRetValue = false; if (boRetValueDebit) { return(true); } if (boRetValueCredit) { return(true); } return(boRetValue); }