Esempio n. 1
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();
        }
Esempio n. 2
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";
        }
Esempio n. 3
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;
        }
Esempio n. 4
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);
        }
Esempio n. 5
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;
        }