Exemple #1
0
        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);
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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";
        }
Exemple #4
0
        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");
        }
Exemple #5
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;
        }
Exemple #6
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);
        }
Exemple #7
0
        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();
        }
Exemple #8
0
        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;
        }
Exemple #9
0
//		private void DeleteTempDirectory(string Path)
//		{
//			if (Directory.Exists(Path))
//			{
//				DirectoryInfo dir = new DirectoryInfo(Path);
//				dir.Delete(true);
//			}
//
//			Directory.CreateDirectory(Path);
//
//		}

        #endregion

        #region SetDataSource

        private void SetDataSource(ReportDocument Report)
        {
            ReportDataset rptds = new ReportDataset();

            ChartOfAccounts clsChartOfAccount = new ChartOfAccounts();
            MySqlDataReader myreader          = clsChartOfAccount.List("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);
        }
Exemple #10
0
        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;
        }