private bool Delete() { bool boRetValue = false; string stIDs = ""; foreach (DataListItem item in lstAccountSummary.Items) { DataList lstAccountCategory = (DataList)item.FindControl("lstAccountCategory"); foreach (DataListItem itemAccountCategory in lstAccountCategory.Items) { HtmlInputCheckBox chkList = (HtmlInputCheckBox)itemAccountCategory.FindControl("chkList"); if (chkList != null) { if (chkList.Checked == true) { stIDs += chkList.Value + ","; boRetValue = true; } } } } if (boRetValue) { AccountCategories clsAccountCategory = new AccountCategories(); clsAccountCategory.Delete(stIDs.Substring(0, stIDs.Length - 1)); clsAccountCategory.CommitAndDispose(); } return(boRetValue); }
private void LoadAccountCategoryList(DataList lstAccountCategory, int AccountSummaryID) { AccountCategories clsAccountCategory = new AccountCategories(); DataClass clsDataClass = new DataClass(); System.Data.DataTable dt = clsDataClass.DataReaderToDataTable(clsAccountCategory.List(AccountSummaryID, "AccountCategoryCode", SortOption.Ascending)); clsAccountCategory.CommitAndDispose(); lstAccountCategory.DataSource = dt.DefaultView; lstAccountCategory.DataBind(); }
private void LoadOptions() { AccountCategories clsAccountCategory = new AccountCategories(); DataClass clsDataClass = new DataClass(); cboAccountCategory.DataTextField = "AccountCategoryName"; cboAccountCategory.DataValueField = "AccountCategoryID"; cboAccountCategory.DataSource = clsDataClass.DataReaderToDataTable(clsAccountCategory.List("AccountCategoryName", SortOption.Ascending)).DefaultView; cboAccountCategory.DataBind(); cboAccountCategory.SelectedIndex = cboAccountCategory.Items.Count - 1; clsAccountCategory.CommitAndDispose(); }
private void LoadRecord() { Int32 iID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"], Session.SessionID)); AccountCategories clsAccountCategory = new AccountCategories(); AccountCategoryDetails clsDetails = clsAccountCategory.Details(iID); clsAccountCategory.CommitAndDispose(); lblAccountCategoryID.Text = clsDetails.AccountCategoryID.ToString(); cboAccountSummary.SelectedIndex = cboAccountSummary.Items.IndexOf(cboAccountSummary.Items.FindByValue(clsDetails.AccountSummaryDetails.AccountSummaryID.ToString())); txtAccountCategoryCode.Text = clsDetails.AccountCategoryCode; txtAccountCategoryName.Text = clsDetails.AccountCategoryName; }
private void SaveRecord() { AccountCategoryDetails clsDetails = new AccountCategoryDetails(); clsDetails.AccountCategoryID = Convert.ToInt16(lblAccountCategoryID.Text); clsDetails.AccountSummaryDetails = new AccountSummaryDetails { AccountSummaryID = Convert.ToInt32(cboAccountSummary.SelectedItem.Value) }; clsDetails.AccountCategoryCode = txtAccountCategoryCode.Text; clsDetails.AccountCategoryName = txtAccountCategoryName.Text; AccountCategories clsAccountCategory = new AccountCategories(); clsAccountCategory.Update(clsDetails); clsAccountCategory.CommitAndDispose(); }
private Int32 SaveRecord() { AccountCategoryDetails clsDetails = new AccountCategoryDetails(); clsDetails.AccountSummaryDetails = new AccountSummaryDetails { AccountSummaryID = Convert.ToInt32(cboAccountSummary.SelectedItem.Value) }; clsDetails.AccountCategoryCode = txtAccountCategoryCode.Text; clsDetails.AccountCategoryName = txtAccountCategoryName.Text; AccountCategories clsAccountCategory = new AccountCategories(); Int32 id = clsAccountCategory.Insert(clsDetails); clsAccountCategory.CommitAndDispose(); return(id); }