private void SaveDebit() { GJournalsDebitDetails clsDetails = new GJournalsDebitDetails(); clsDetails.GJournalID = Convert.ToInt64(lblGJournalID.Text); clsDetails.ChartOfAccountID = Convert.ToInt32(cboAccount.SelectedItem.Value); clsDetails.Amount = Convert.ToDecimal(txtAmount.Text); GJournalsDebit clsGJournalsDebit = new GJournalsDebit(); clsGJournalsDebit.Insert(clsDetails); clsGJournalsDebit.CommitAndDispose(); }
private void LoadItems() { long GJournalID = Convert.ToInt64(lblGJournalID.Text); DataClass clsDataClass = new DataClass(); GJournalsDebit clsGJournalsDebit = new GJournalsDebit(); lstGJournalsDebit.DataSource = clsDataClass.DataReaderToDataTable(clsGJournalsDebit.List(GJournalID, "GJournalDebitID", SortOption.Ascending)).DefaultView; lstGJournalsDebit.DataBind(); GJournalsCredit clsGJournalsCredit = new GJournalsCredit(clsGJournalsDebit.Connection, clsGJournalsDebit.Transaction); lstGJournalsCredit.DataSource = clsDataClass.DataReaderToDataTable(clsGJournalsCredit.List(GJournalID, "GJournalCreditID", SortOption.Ascending)).DefaultView; lstGJournalsCredit.DataBind(); clsGJournalsDebit.CommitAndDispose(); }
private bool DeleteItems() { bool boRetValueDebit = false; string stIDs = ""; foreach (DataListItem item in lstGJournalsDebit.Items) { HtmlInputCheckBox chkListDebit = (HtmlInputCheckBox)item.FindControl("chkListDebit"); if (chkListDebit != null) { if (chkListDebit.Checked == true) { stIDs += chkListDebit.Value + ","; boRetValueDebit = true; } } } if (boRetValueDebit) { GJournalsDebit clsGJournalsDebit = new GJournalsDebit(); clsGJournalsDebit.Delete(stIDs.Substring(0, stIDs.Length - 1)); clsGJournalsDebit.CommitAndDispose(); } bool boRetValueCredit = false; stIDs = ""; foreach (DataListItem item in lstGJournalsCredit.Items) { HtmlInputCheckBox chkListCredit = (HtmlInputCheckBox)item.FindControl("chkListCredit"); if (chkListCredit != null) { if (chkListCredit.Checked == true) { stIDs += chkListCredit.Value + ","; boRetValueCredit = true; } } } if (boRetValueCredit) { GJournalsCredit clsGJournalsCredit = new GJournalsCredit(); clsGJournalsCredit.Delete(stIDs.Substring(0, stIDs.Length - 1)); clsGJournalsCredit.CommitAndDispose(); } bool boRetValue = false; if (boRetValueDebit) { return(true); } if (boRetValueCredit) { return(true); } return(boRetValue); }