Example #1
0
        public void BuildSales()
        {
            // add non-grouped accounts
            ss.AddAccount("NON GROUPED", "4");
            // add normal accounts
            List <string> groupNameList = new List <string>();
            List <string> groupIDList   = new List <string>();
            ExcoODBC      solarsoft     = ExcoODBC.Instance;

            solarsoft.Open(Database.CMSDAT);
            string         query  = "select bq1grp, bq1titl from cmsdat.fgrp where bq1lvl='A' and bq1grp like '4%' and bq1comp='" + plantID.ToString("D2") + "'";
            OdbcDataReader reader = solarsoft.RunQuery(query);

            while (reader.Read())
            {
                groupNameList.Add(reader["bq1titl"].ToString().Trim());
                groupIDList.Add(reader["bq1grp"].ToString().Trim());
            }
            reader.Close();
            for (int i = 0; i < groupIDList.Count; i++)
            {
                ss.AddAccount(groupNameList[i], groupIDList[i]);
            }

            //GetNonGroupedAccounts(4, ss);
        }
Example #2
0
        public void BuildDirectLabour()
        {
            List <string> groupNameList = new List <string>();
            List <string> groupIDList   = new List <string>();
            ExcoODBC      solarsoft     = ExcoODBC.Instance;

            solarsoft.Open(Database.CMSDAT);
            string query = string.Empty;

            switch (plantID)
            {
            case 1:
            case 3:
                query = "select bq1grp, bq1titl from cmsdat.fgrp where bq1lvl='B' and bq1grp like '502%' and bq1comp='" + plantID.ToString("D2") + "'";
                break;

            case 5:
            case 4:
                query = "select bq1grp, bq1titl from cmsdat.fgrp where bq1lvl='B' and bq1grp like '520%' and bq1comp='" + plantID.ToString("D2") + "'";
                break;
            }
            OdbcDataReader reader = solarsoft.RunQuery(query);

            while (reader.Read())
            {
                groupNameList.Add(reader["bq1titl"].ToString().Trim());
                groupIDList.Add(reader["bq1grp"].ToString().Trim());
            }
            reader.Close();
            for (int i = 0; i < groupIDList.Count; i++)
            {
                dl.AddAccount(groupNameList[i], groupIDList[i]);
            }
        }
Example #3
0
        public void BuildGeneralAdmin()
        {
            // add non-grouped accounts
            ga.AddAccount("NON GROUPED", "6");
            // add normal accounts
            List <string> groupNameList = new List <string>();
            List <string> groupIDList   = new List <string>();
            ExcoODBC      solarsoft     = ExcoODBC.Instance;

            solarsoft.Open(Database.CMSDAT);
            string query = string.Empty;

            switch (plantID)
            {
            case 1:
            case 3:
                query = "select bq1grp, bq1titl from cmsdat.fgrp where bq1lvl='B' and bq1grp like '6GA%' and bq1comp='" + plantID.ToString("D2") + "'";
                break;

            case 5:
            case 4:
                query = "select bq1grp, bq1titl from cmsdat.fgrp where bq1lvl='B' and bq1grp like '620%' and bq1comp='" + plantID.ToString("D2") + "'";
                break;
            }
            OdbcDataReader reader = solarsoft.RunQuery(query);

            while (reader.Read())
            {
                groupNameList.Add(reader["bq1titl"].ToString().Trim());
                groupIDList.Add(reader["bq1grp"].ToString().Trim());
            }
            reader.Close();
            for (int i = 0; i < groupIDList.Count; i++)
            {
                ga.AddAccount(groupNameList[i], groupIDList[i]);
            }
            // get non-grouped accounts
            //GetNonGroupedAccounts(6, ga);
        }