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 void LoadOptions() { ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); System.Data.DataTable dtList = clsChartOfAccount.ListAsDataTable("ChartOfAccountID", SortOption.Ascending); clsChartOfAccount.CommitAndDispose(); cboChartOfAccountAPTracking.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountAPTracking.DataValueField = "ChartOfAccountID"; cboChartOfAccountAPTracking.DataSource = dtList.DefaultView; cboChartOfAccountAPTracking.DataBind(); cboChartOfAccountAPTracking.SelectedIndex = cboChartOfAccountAPTracking.Items.Count - 1; cboChartOfAccountAPBills.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountAPBills.DataValueField = "ChartOfAccountID"; cboChartOfAccountAPBills.DataSource = dtList.DefaultView; cboChartOfAccountAPBills.DataBind(); cboChartOfAccountAPBills.SelectedIndex = cboChartOfAccountAPBills.Items.Count - 1; cboChartOfAccountAPFreight.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountAPFreight.DataValueField = "ChartOfAccountID"; cboChartOfAccountAPFreight.DataSource = dtList.DefaultView; cboChartOfAccountAPFreight.DataBind(); cboChartOfAccountAPFreight.Items.Add(new ListItem("Not Applicable","0")); cboChartOfAccountAPFreight.SelectedIndex = cboChartOfAccountAPFreight.Items.Count - 1; cboChartOfAccountAPVDeposit.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountAPVDeposit.DataValueField = "ChartOfAccountID"; cboChartOfAccountAPVDeposit.DataSource = dtList.DefaultView; cboChartOfAccountAPVDeposit.DataBind(); cboChartOfAccountAPVDeposit.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountAPVDeposit.SelectedIndex = cboChartOfAccountAPVDeposit.Items.Count - 1; cboChartOfAccountAPContra.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountAPContra.DataValueField = "ChartOfAccountID"; cboChartOfAccountAPContra.DataSource = dtList.DefaultView; cboChartOfAccountAPContra.DataBind(); cboChartOfAccountAPContra.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountAPContra.SelectedIndex = cboChartOfAccountAPContra.Items.Count - 1; cboChartOfAccountAPLatePayment.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountAPLatePayment.DataValueField = "ChartOfAccountID"; cboChartOfAccountAPLatePayment.DataSource = dtList.DefaultView; cboChartOfAccountAPLatePayment.DataBind(); cboChartOfAccountAPLatePayment.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountAPLatePayment.SelectedIndex = cboChartOfAccountAPLatePayment.Items.Count - 1; }
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(); }
private void SetDataSource(ReportDocument Report) { ReportDataset rptds = new ReportDataset(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); MySqlDataReader myreader = clsChartOfAccount.BalanceSheet("ChartOfAccountID", SortOption.Ascending); clsChartOfAccount.CommitAndDispose(); while(myreader.Read()) { DataRow drNew = rptds.ChartOfAccount.NewRow(); foreach (DataColumn dc in rptds.ChartOfAccount.Columns) drNew[dc] = "" + myreader[dc.ColumnName]; rptds.ChartOfAccount.Rows.Add(drNew); } Report.SetDataSource(rptds); SetParameters(Report); }
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) { DataList lstChartOfAccounts = (DataList)itemAccountCategory.FindControl("lstChartOfAccounts"); foreach (DataListItem itemChartOfAccounts in lstChartOfAccounts.Items) { HtmlInputCheckBox chkList = (HtmlInputCheckBox)itemChartOfAccounts.FindControl("chkList"); if (chkList != null) { if (chkList.Checked == true) { stIDs += chkList.Value + ","; boRetValue = true; } } } } } if (boRetValue) { ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); clsChartOfAccount.Delete( stIDs.Substring(0,stIDs.Length-1)); clsChartOfAccount.CommitAndDispose(); } return boRetValue; }
private void LoadChartOfAccountList(DataList lstChartOfAccount, int AccountCategoryID) { ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); DataClass clsDataClass = new DataClass(); System.Data.DataTable dt = clsDataClass.DataReaderToDataTable(clsChartOfAccount.List(AccountCategoryID, "ChartOfAccountCode", SortOption.Ascending)); clsChartOfAccount.CommitAndDispose(); lstChartOfAccount.DataSource = dt.DefaultView; lstChartOfAccount.DataBind(); }
public void Post(long BankDepositID, decimal Amount) { try { string SQL = "UPDATE tblBankDeposit SET " + "DepositStatus = @DepositStatus " + "WHERE BankDepositID = @BankDepositID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; cmd.Parameters.AddWithValue("@DepositStatus", BankDepositStatus.Posted.ToString("d")); cmd.Parameters.AddWithValue("@BankDepositID", BankDepositID); base.ExecuteNonQuery(cmd); BankDepositDetails clsBankDepositDetails = Details(BankDepositID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); clsChartOfAccount.UpdateDebit(clsBankDepositDetails.DepositInAccountID, clsBankDepositDetails.DepositItemAmount); clsChartOfAccount.UpdateCredit(clsBankDepositDetails.DepositInAccountID, clsBankDepositDetails.CashBackAmount); clsChartOfAccount.UpdateDebit(clsBankDepositDetails.CashBackAccountID, clsBankDepositDetails.CashBackAmount); clsChartOfAccount.UpdateCredit(clsBankDepositDetails.DepositItemAccountID, clsBankDepositDetails.DepositItemAmount); } catch (Exception ex) { throw base.ThrowException(ex); } }
private void LoadOptions() { DataClass clsDataClass = new DataClass(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); System.Data.DataTable dtList = clsDataClass.DataReaderToDataTable(clsChartOfAccount.List("ChartOfAccountName", SortOption.Ascending)); clsChartOfAccount.CommitAndDispose(); cboChartOfAccountPurchase.DataTextField = "ChartOfAccountName"; cboChartOfAccountPurchase.DataValueField = "ChartOfAccountID"; cboChartOfAccountPurchase.DataSource = dtList.DefaultView; cboChartOfAccountPurchase.DataBind(); cboChartOfAccountPurchase.SelectedIndex = cboChartOfAccountPurchase.Items.Count - 1; cboChartOfAccountSold.DataTextField = "ChartOfAccountName"; cboChartOfAccountSold.DataValueField = "ChartOfAccountID"; cboChartOfAccountSold.DataSource = dtList.DefaultView; cboChartOfAccountSold.DataBind(); cboChartOfAccountSold.SelectedIndex = cboChartOfAccountSold.Items.Count - 1; cboChartOfAccountInventory.DataTextField = "ChartOfAccountName"; cboChartOfAccountInventory.DataValueField = "ChartOfAccountID"; cboChartOfAccountInventory.DataSource = dtList.DefaultView; cboChartOfAccountInventory.DataBind(); cboChartOfAccountInventory.SelectedIndex = cboChartOfAccountInventory.Items.Count - 1; cboChartOfAccountIDTaxPurchase.DataTextField = "ChartOfAccountName"; cboChartOfAccountIDTaxPurchase.DataValueField = "ChartOfAccountID"; cboChartOfAccountIDTaxPurchase.DataSource = dtList.DefaultView; cboChartOfAccountIDTaxPurchase.DataBind(); cboChartOfAccountIDTaxPurchase.SelectedIndex = cboChartOfAccountIDTaxPurchase.Items.Count - 1; cboChartOfAccountIDTaxSold.DataTextField = "ChartOfAccountName"; cboChartOfAccountIDTaxSold.DataValueField = "ChartOfAccountID"; cboChartOfAccountIDTaxSold.DataSource = dtList.DefaultView; cboChartOfAccountIDTaxSold.DataBind(); cboChartOfAccountIDTaxSold.SelectedIndex = cboChartOfAccountIDTaxSold.Items.Count - 1; }
public void Post(long GJournalID) { try { GetConnection(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(Connection, Transaction); MySqlDataReader myReader = List(GJournalID, "GJournalDebitID",SortOption.Ascending); while (myReader.Read()) { int ChartOfAccountID = myReader.GetInt32("ChartOfAccountID"); decimal Amount = myReader.GetDecimal("Amount"); clsChartOfAccount.UpdateDebit(ChartOfAccountID, Amount); } myReader.Close(); } catch (Exception ex) { { } throw base.ThrowException(ex); } }
private void UpdateAccounts(long DebitMemoID) { try { DebitMemoDetails clsDebitMemoDetails = Details(DebitMemoID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDAPTracking as credit clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPTracking, clsDebitMemoDetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPContra, clsDebitMemoDetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateDebit(clsDebitMemoDetails.ChartOfAccountIDAPTracking, clsDebitMemoDetails.Freight); clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPFreight, clsDebitMemoDetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateDebit(clsDebitMemoDetails.ChartOfAccountIDAPTracking, clsDebitMemoDetails.Deposit); clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPVDeposit, clsDebitMemoDetails.Deposit); DebitMemoItems clsDebitMemoItems = new DebitMemoItems(base.Connection, base.Transaction); System.Data.DataTable dt = clsDebitMemoItems.ListAsDataTable(DebitMemoID); foreach(System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDPurchase = Int16.Parse(dr["ChartOfAccountIDPurchase"].ToString()); int iChartOfAccountIDTaxPurchase = Int16.Parse(dr["ChartOfAccountIDTaxPurchase"].ToString()); decimal decVAT = decimal.Parse(dr["VAT"].ToString()); decimal decVATABLEAmount = decimal.Parse(dr["Amount"].ToString())-decVAT; // update purchase as debit clsChartOfAccount.UpdateCredit(iChartOfAccountIDPurchase, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateCredit(iChartOfAccountIDTaxPurchase, decVAT); } } catch (Exception ex) { throw base.ThrowException(ex); } }
private void UpdateAccounts(long SOID) { try { SODetails clsSODetails = Details(SOID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDARTracking as credit clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARTracking, clsSODetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARContra, clsSODetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARTracking, clsSODetails.Freight); clsChartOfAccount.UpdateDebit(clsSODetails.ChartOfAccountIDARFreight, clsSODetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARTracking, clsSODetails.Deposit); clsChartOfAccount.UpdateDebit(clsSODetails.ChartOfAccountIDARVDeposit, clsSODetails.Deposit); SOItem clsSOItem = new SOItem(base.Connection, base.Transaction); System.Data.DataTable dt = clsSOItem.ListAsDataTable(SOID, "SOItemID", SortOption.Ascending); foreach (System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDSold = Int16.Parse(dr["ChartOfAccountIDSold"].ToString()); int iChartOfAccountIDTaxSold = Int16.Parse(dr["ChartOfAccountIDTaxSold"].ToString()); decimal decVAT = decimal.Parse(dr["VAT"].ToString()); decimal decVATABLEAmount = decimal.Parse(dr["Amount"].ToString()) - decVAT; // update purchase as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDSold, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDTaxSold, decVAT); } } catch (Exception ex) { base.ThrowException(ex); } }
private void UpdateAccounts(long POID) { try { PODetails clsPODetails = Details(POID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDAPTracking as credit clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPTracking, clsPODetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPContra, clsPODetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPTracking, clsPODetails.Freight); clsChartOfAccount.UpdateDebit(clsPODetails.ChartOfAccountIDAPFreight, clsPODetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPTracking, clsPODetails.Deposit); clsChartOfAccount.UpdateDebit(clsPODetails.ChartOfAccountIDAPVDeposit, clsPODetails.Deposit); POItem clsPOItem = new POItem(base.Connection, base.Transaction); System.Data.DataTable dt = clsPOItem.ListAsDataTable(POID, "POItemID", SortOption.Ascending); foreach (System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDPurchase = Convert.ToInt16(dr["ChartOfAccountIDPurchase"]); int iChartOfAccountIDTaxPurchase = Convert.ToInt16(dr["ChartOfAccountIDTaxPurchase"]); decimal decVAT = Convert.ToDecimal(dr["VAT"]); decimal decVATABLEAmount = Convert.ToDecimal(dr["Amount"]) - decVAT; // update purchase as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDPurchase, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDTaxPurchase, decVAT); } } catch (Exception ex) { throw base.ThrowException(ex); } }
private void LoadAccount() { DataClass clsDataClass = new DataClass(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); cboAccount.DataTextField = "ChartOfAccountName"; cboAccount.DataValueField = "ChartOfAccountID"; cboAccount.DataSource = clsDataClass.DataReaderToDataTable(clsChartOfAccount.List("ChartOfAccountName", SortOption.Ascending)).DefaultView; cboAccount.DataBind(); clsChartOfAccount.CommitAndDispose(); cboAccount.SelectedIndex = 0; txtAmount.Text = "0.00"; }
private void LoadOptions() { DataClass clsDataClass = new DataClass(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(); System.Data.DataTable dtList = clsDataClass.DataReaderToDataTable(clsChartOfAccount.List("ChartOfAccountName", SortOption.Ascending)); ProductGroup clsProductGroup = new ProductGroup(clsChartOfAccount.Connection, clsChartOfAccount.Transaction); System.Data.DataTable dtProductGroup = clsProductGroup.ListAsDataTable(SortField:"ProductGroupName"); ProductSubGroupColumns clsProductSubGroupColumns = new ProductSubGroupColumns() { ColumnsNameID = true }; ProductSubGroup clsSubGroup = new ProductSubGroup(clsChartOfAccount.Connection, clsChartOfAccount.Transaction); System.Data.DataTable dtProductSubGroup = clsSubGroup.ListAsDataTable(clsProductSubGroupColumns, SortField: "ProductSubGroupName", SortOrder: System.Data.SqlClient.SortOrder.Ascending); Products clsProduct = new Products(clsChartOfAccount.Connection, clsChartOfAccount.Transaction); System.Data.DataTable dtProduct = clsProduct.ListAsDataTable("ProductID", SortOption.Ascending); clsChartOfAccount.CommitAndDispose(); cboProductGroup.DataTextField = "ProductGroupName"; cboProductGroup.DataValueField = "ProductGroupID"; cboProductGroup.DataSource = dtProductGroup.DefaultView; cboProductGroup.DataBind(); cboProductGroup.Items.Add(new ListItem("Apply to all Product Groups", "0")); cboProductGroup.SelectedIndex = cboProductGroup.Items.Count - 1; cboProductSubGroup.DataTextField = "ProductSubGroupName"; cboProductSubGroup.DataValueField = "ProductSubGroupID"; cboProductSubGroup.DataSource = dtProductSubGroup.DefaultView; cboProductSubGroup.DataBind(); cboProductSubGroup.Items.Add(new ListItem("Do not Apply to Product Sub Groups", "-1")); cboProductSubGroup.Items.Add(new ListItem("Apply to all Product Sub Groups", "0")); cboProductSubGroup.SelectedIndex = cboProductSubGroup.Items.Count - 1; cboProduct.DataTextField = "ProductCode"; cboProduct.DataValueField = "ProductID"; cboProduct.DataSource = dtProduct.DefaultView; cboProduct.DataBind(); cboProduct.Items.Add(new ListItem("Do not Apply to Products", "-1")); cboProduct.Items.Add(new ListItem("Apply to all Products", "0")); cboProduct.SelectedIndex = cboProduct.Items.Count - 1; cboChartOfAccountPurchase.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountPurchase.DataValueField = "ChartOfAccountID"; cboChartOfAccountPurchase.DataSource = dtList.DefaultView; cboChartOfAccountPurchase.DataBind(); cboChartOfAccountPurchase.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountPurchase.SelectedIndex = cboChartOfAccountPurchase.Items.Count - 1; cboChartOfAccountSold.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountSold.DataValueField = "ChartOfAccountID"; cboChartOfAccountSold.DataSource = dtList.DefaultView; cboChartOfAccountSold.DataBind(); cboChartOfAccountSold.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountSold.SelectedIndex = cboChartOfAccountSold.Items.Count - 1; cboChartOfAccountInventory.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountInventory.DataValueField = "ChartOfAccountID"; cboChartOfAccountInventory.DataSource = dtList.DefaultView; cboChartOfAccountInventory.DataBind(); cboChartOfAccountInventory.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountInventory.SelectedIndex = cboChartOfAccountInventory.Items.Count - 1; cboChartOfAccountIDTaxPurchase.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountIDTaxPurchase.DataValueField = "ChartOfAccountID"; cboChartOfAccountIDTaxPurchase.DataSource = dtList.DefaultView; cboChartOfAccountIDTaxPurchase.DataBind(); cboChartOfAccountIDTaxPurchase.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountIDTaxPurchase.SelectedIndex = cboChartOfAccountIDTaxPurchase.Items.Count - 1; cboChartOfAccountIDTaxSold.DataTextField = "ChartOfAccountNameComplete"; cboChartOfAccountIDTaxSold.DataValueField = "ChartOfAccountID"; cboChartOfAccountIDTaxSold.DataSource = dtList.DefaultView; cboChartOfAccountIDTaxSold.DataBind(); cboChartOfAccountIDTaxSold.Items.Add(new ListItem("Not Applicable", "0")); cboChartOfAccountIDTaxSold.SelectedIndex = cboChartOfAccountIDTaxSold.Items.Count - 1; }
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; }