private void LoadRecord() { Int32 iID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"],Session.SessionID)); AccountSummaries clsAccountSummary = new AccountSummaries(); AccountSummaryDetails clsDetails = clsAccountSummary.Details(iID); clsAccountSummary.CommitAndDispose(); lblAccountSummaryID.Text = clsDetails.AccountSummaryID.ToString(); cboAccountClassification.SelectedIndex = cboAccountClassification.Items.IndexOf(cboAccountClassification.Items.FindByValue(clsDetails.AccountClassificationDetails.AccountClassificationID.ToString())); txtAccountSummaryCode.Text = clsDetails.AccountSummaryCode; txtAccountSummaryName.Text = clsDetails.AccountSummaryName; }
private void LoadOptions() { AccountSummaries clsAccountSummary = new AccountSummaries(); DataClass clsDataClass = new DataClass(); cboAccountSummary.DataTextField = "AccountSummaryName"; cboAccountSummary.DataValueField = "AccountSummaryID"; cboAccountSummary.DataSource = clsDataClass.DataReaderToDataTable(clsAccountSummary.List("AccountSummaryName",SortOption.Ascending)).DefaultView; cboAccountSummary.DataBind(); cboAccountSummary.SelectedIndex = cboAccountSummary.Items.Count - 1; clsAccountSummary.CommitAndDispose(); }
public ChartOfAccountDetails Details(Int32 ChartOfAccountID) { try { string SQL = SQLSelect() + "WHERE ChartOfAccountID = @ChartOfAccountID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmChartOfAccountID = new MySqlParameter("@ChartOfAccountID", MySqlDbType.Int16); prmChartOfAccountID.Value = ChartOfAccountID; cmd.Parameters.Add(prmChartOfAccountID); System.Data.DataTable dt = new System.Data.DataTable("ChartOfAccount"); MySqlDataAdapter adapter = new MySqlDataAdapter(cmd); adapter.Fill(dt); ChartOfAccountDetails Details = new ChartOfAccountDetails(); AccountCategories clsAccountCategory = new AccountCategories(this.Connection, this.Transaction); AccountSummaries clsAccountSummary = new AccountSummaries(this.Connection, this.Transaction); AccountClassifications clsAccountClassification = new AccountClassifications(this.Connection, this.Transaction); foreach (System.Data.DataRow dr in dt.Rows) { Details.ChartOfAccountID = ChartOfAccountID; Details.ChartOfAccountCode = "" + dr["ChartOfAccountCode"].ToString(); Details.ChartOfAccountName = "" + dr["ChartOfAccountName"].ToString(); Details.Debit = decimal.Parse(dr["Debit"].ToString()); Details.Credit = decimal.Parse(dr["Credit"].ToString()); Details.AccountCategoryDetails = clsAccountCategory.Details(Int32.Parse(dr["AccountCategoryID"].ToString())); //Details.AccountSummaryDetails = clsAccountSummary.Details(Int32.Parse(dr["AccountSummaryID"].ToString())); //Details.AccountClassificationDetails = clsAccountClassification.Details(Int16.Parse(dr["AccountClassificationID"].ToString())); } return(Details); } catch (Exception ex) { { } throw base.ThrowException(ex); } }
public AccountCategoryDetails Details(Int32 AccountCategoryID) { try { string SQL = SQLSelect() + "WHERE AccountCategoryID = @AccountCategoryID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmAccountCategoryID = new MySqlParameter("@AccountCategoryID", MySqlDbType.Int16); prmAccountCategoryID.Value = AccountCategoryID; cmd.Parameters.Add(prmAccountCategoryID); string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName); base.MySqlDataAdapterFill(cmd, dt); AccountCategoryDetails Details = new AccountCategoryDetails(); AccountSummaries clsAccountSummary = new AccountSummaries(this.Connection, this.Transaction); AccountClassifications clsAccountClassification = new AccountClassifications(this.Connection, this.Transaction); foreach (System.Data.DataRow dr in dt.Rows) { Details.AccountCategoryID = AccountCategoryID; Details.AccountCategoryCode = "" + dr["AccountCategoryCode"].ToString(); Details.AccountCategoryName = "" + dr["AccountCategoryName"].ToString(); Details.AccountSummaryDetails = clsAccountSummary.Details(Int32.Parse(dr["AccountSummaryID"].ToString())); //Details.AccountClassificationDetails = Details.AccountSummaryDetails.AccountClassificationDetails; } return(Details); } catch (Exception ex) { throw base.ThrowException(ex); } }
private void LoadAccountSummaryList() { AccountSummaries clsAccountSummary = new AccountSummaries(); DataClass clsDataClass = new DataClass(); string SortField = "AccountSummaryCode"; if (Request.QueryString["sortfield"]!=null) { SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID); } SortOption sortoption = SortOption.Ascending; if (Request.QueryString["sortoption"]!=null) { sortoption = (SortOption) Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true); } if (Request.QueryString["Search"]==null) { PageData.DataSource = clsDataClass.DataReaderToDataTable(clsAccountSummary.List(SortField, sortoption)).DefaultView; } else { string SearchKey = Common.Decrypt((string)Request.QueryString["search"],Session.SessionID); PageData.DataSource = clsDataClass.DataReaderToDataTable(clsAccountSummary.Search(SearchKey, SortField, sortoption)).DefaultView; } clsAccountSummary.CommitAndDispose(); int iPageSize = Convert.ToInt16(Session["PageSize"]) ; PageData.AllowPaging = true; PageData.PageSize = iPageSize; try { PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1; lstAccountSummary.DataSource = PageData; lstAccountSummary.DataBind(); } catch { PageData.CurrentPageIndex = 1; lstAccountSummary.DataSource = PageData; lstAccountSummary.DataBind(); } cboCurrentPage.Items.Clear(); for (int i=0; i < PageData.PageCount;i++) { int iValue = i + 1; cboCurrentPage.Items.Add(new ListItem(iValue.ToString(),iValue.ToString())); if (PageData.CurrentPageIndex == i) { cboCurrentPage.Items[i].Selected = true;} else { cboCurrentPage.Items[i].Selected = false;} } lblDataCount.Text = " of " + " " + PageData.PageCount; }
public AccountCategoryDetails Details(Int32 AccountCategoryID) { try { string SQL = SQLSelect() + "WHERE AccountCategoryID = @AccountCategoryID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmAccountCategoryID = new MySqlParameter("@AccountCategoryID",MySqlDbType.Int16); prmAccountCategoryID.Value = AccountCategoryID; cmd.Parameters.Add(prmAccountCategoryID); string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName); base.MySqlDataAdapterFill(cmd, dt); AccountCategoryDetails Details = new AccountCategoryDetails(); AccountSummaries clsAccountSummary = new AccountSummaries(this.Connection, this.Transaction); AccountClassifications clsAccountClassification = new AccountClassifications(this.Connection, this.Transaction); foreach(System.Data.DataRow dr in dt.Rows) { Details.AccountCategoryID = AccountCategoryID; Details.AccountCategoryCode = "" + dr["AccountCategoryCode"].ToString(); Details.AccountCategoryName = "" + dr["AccountCategoryName"].ToString(); Details.AccountSummaryDetails = clsAccountSummary.Details(Int32.Parse(dr["AccountSummaryID"].ToString())); //Details.AccountClassificationDetails = Details.AccountSummaryDetails.AccountClassificationDetails; } return Details; } catch (Exception ex) { throw base.ThrowException(ex); } }
private Int32 SaveRecord() { AccountSummaryDetails clsDetails = new AccountSummaryDetails(); clsDetails.AccountClassificationDetails = new AccountClassificationDetails { AccountClassificationID = Convert.ToInt16(cboAccountClassification.SelectedItem.Value) }; clsDetails.AccountSummaryCode = txtAccountSummaryCode.Text; clsDetails.AccountSummaryName = txtAccountSummaryName.Text; AccountSummaries clsAccountSummary = new AccountSummaries(); Int32 id = clsAccountSummary.Insert(clsDetails); clsAccountSummary.CommitAndDispose(); return id; }
private void SaveRecord() { AccountSummaryDetails clsDetails = new AccountSummaryDetails(); clsDetails.AccountSummaryID = Convert.ToInt16(lblAccountSummaryID.Text); clsDetails.AccountClassificationDetails = new AccountClassificationDetails { AccountClassificationID = Convert.ToInt16(cboAccountClassification.SelectedItem.Value) }; clsDetails.AccountSummaryCode = txtAccountSummaryCode.Text; clsDetails.AccountSummaryName = txtAccountSummaryName.Text; AccountSummaries clsAccountSummary = new AccountSummaries(); clsAccountSummary.Update(clsDetails); clsAccountSummary.CommitAndDispose(); }
private bool Delete() { bool boRetValue = false; string stIDs = ""; foreach(DataListItem item in lstItem.Items) { HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList"); if (chkList!=null) { if (chkList.Checked == true) { stIDs += chkList.Value + ","; boRetValue = true; } } } if (boRetValue) { AccountSummaries clsAccountSummary = new AccountSummaries(); clsAccountSummary.Delete( stIDs.Substring(0,stIDs.Length-1)); clsAccountSummary.CommitAndDispose(); } return boRetValue; }
public ChartOfAccountDetails Details(Int32 ChartOfAccountID) { try { string SQL = SQLSelect() + "WHERE ChartOfAccountID = @ChartOfAccountID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmChartOfAccountID = new MySqlParameter("@ChartOfAccountID",MySqlDbType.Int16); prmChartOfAccountID.Value = ChartOfAccountID; cmd.Parameters.Add(prmChartOfAccountID); System.Data.DataTable dt = new System.Data.DataTable("ChartOfAccount"); MySqlDataAdapter adapter = new MySqlDataAdapter(cmd); adapter.Fill(dt); ChartOfAccountDetails Details = new ChartOfAccountDetails(); AccountCategories clsAccountCategory = new AccountCategories(this.Connection, this.Transaction); AccountSummaries clsAccountSummary = new AccountSummaries(this.Connection, this.Transaction); AccountClassifications clsAccountClassification = new AccountClassifications(this.Connection, this.Transaction); foreach(System.Data.DataRow dr in dt.Rows) { Details.ChartOfAccountID = ChartOfAccountID; Details.ChartOfAccountCode = "" + dr["ChartOfAccountCode"].ToString(); Details.ChartOfAccountName = "" + dr["ChartOfAccountName"].ToString(); Details.Debit = decimal.Parse(dr["Debit"].ToString()); Details.Credit = decimal.Parse(dr["Credit"].ToString()); Details.AccountCategoryDetails = clsAccountCategory.Details(Int32.Parse(dr["AccountCategoryID"].ToString())); //Details.AccountSummaryDetails = clsAccountSummary.Details(Int32.Parse(dr["AccountSummaryID"].ToString())); //Details.AccountClassificationDetails = clsAccountClassification.Details(Int16.Parse(dr["AccountClassificationID"].ToString())); } return Details; } catch (Exception ex) { { } throw base.ThrowException(ex); } }