Exemple #1
0
        static void chooseFactory(int id)
        {
            int level = judgeLevel(id);

            if (level == 1) //省级公司
            {
                IFactory      cpyFactory    = new ProvinceFactory();
                CreateCompany createCompany = cpyFactory.createcompany();
                createCompany.CompanyID    = id;
                createCompany.CompanyName  = CompanyName;
                createCompany.Childcompany = DBhelper.GetChildcompany(id);
                createCompany.createword();
            }
            else if (level == 2) //市级公司
            {
                IFactory      cpyFactory    = new CityFactory();
                CreateCompany createCompany = cpyFactory.createcompany();
                createCompany.CompanyID    = id;
                createCompany.CompanyName  = CompanyName;
                createCompany.Childcompany = DBhelper.GetChildcompany(id);
                createCompany.createword();
            }
            else if (level == 3) //县级公司
            {
                IFactory      cpyFactory    = new CountryFactory();
                CreateCompany createCompany = cpyFactory.createcompany();
                createCompany.CompanyID    = id;
                createCompany.CompanyName  = CompanyName;
                createCompany.Childcompany = DBhelper.GetChildcompany(id);
                createCompany.createword();
            }
        }
Exemple #2
0
        private void createWord(int id)
        {
            //int level = judgeLevel(id);
            int           level         = CompanyManager.getSingleton().GetCompanyLevel(id) + 1;
            CreateCompany createCompany = null;

            if (level == 1) //省级公司
            {
                createCompany = DocFactory.createcompany(DocCompanyType.Provice, docCompilationListener);
            }
            else if (level == 2) //市级公司
            {
                createCompany = DocFactory.createcompany(DocCompanyType.City, docCompilationListener);
            }
            else if (level == 3) //县级公司
            {
                createCompany = DocFactory.createcompany(DocCompanyType.Country, docCompilationListener);
            }

            if (createCompany == null)
            {
                return;
            }

            createCompany.CompanyID    = id;
            createCompany.CompanyName  = CompanyName;
            createCompany.Childcompany = DBhelper.GetChildcompany(id);
            createCompany.createword(WordPath);
        }