private void LoadRecord() { Int32 iID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"], Session.SessionID)); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); ChartOfAccountDetails clsDetails = clsChartOfAccount.Details(iID); clsChartOfAccount.CommitAndDispose(); lblAccountID.Text = clsDetails.ChartOfAccountID.ToString(); cboAccountCategory.SelectedIndex = cboAccountCategory.Items.IndexOf(cboAccountCategory.Items.FindByValue(clsDetails.AccountCategoryDetails.AccountCategoryID.ToString())); txtAccountCode.Text = clsDetails.ChartOfAccountCode; txtAccountName.Text = clsDetails.ChartOfAccountName; txtDebit.Text = clsDetails.Debit.ToString("###0.#0"); txtCredit.Text = clsDetails.Credit.ToString("###0.#0"); }
private Int32 SaveRecord() { ChartOfAccountDetails clsDetails = new ChartOfAccountDetails(); clsDetails.AccountCategoryDetails = new AccountCategoryDetails { AccountCategoryID = Convert.ToInt32(cboAccountCategory.SelectedItem.Value), }; clsDetails.ChartOfAccountCode = txtAccountCode.Text; clsDetails.ChartOfAccountName = txtAccountName.Text; ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); Int32 id = clsChartOfAccount.Insert(clsDetails); clsChartOfAccount.CommitAndDispose(); return(id); }
private void SaveRecord() { ChartOfAccountDetails clsDetails = new ChartOfAccountDetails(); clsDetails.ChartOfAccountID = Convert.ToInt16(lblAccountID.Text); clsDetails.AccountCategoryDetails = new AccountCategoryDetails { AccountCategoryID = Convert.ToInt32(cboAccountCategory.SelectedItem.Value) }; clsDetails.ChartOfAccountCode = txtAccountCode.Text; clsDetails.ChartOfAccountName = txtAccountName.Text; clsDetails.Debit = Convert.ToDecimal(txtDebit.Text); clsDetails.Credit = Convert.ToDecimal(txtCredit.Text); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); clsChartOfAccount.Update(clsDetails); clsChartOfAccount.CommitAndDispose(); }