예제 #1
0
        private void CreateSelfProfile(Models.Company.NewCompanyModel newCompany)
        {
            Console.WriteLine("> Create Self Organization Profile");

            if (this.DataItems.Get(Models.Datum.DataItemKey.OrganizationName) == null)
            {
                this.DataItems.Set(Models.Datum.DataItemKey.OrganizationName, newCompany.Name);
                this.DataItems.Set(Models.Datum.DataItemKey.TaxId, newCompany.TaxID);

                var profilesDal = new Repository.Profiles.Profiles(this);

                var erpProfile = new Models.Profiles.Profile()
                {
                    Id                 = Guid.NewGuid(),
                    ProfileType        = Models.Profiles.ProfileType.Organization,
                    Name               = newCompany.Name,
                    CreatedDate        = DateTime.Today,
                    localizedLanguage  = Models.Profiles.EnumLanguage.en,
                    TaxNumber          = newCompany.TaxID,
                    isSelfOrganization = true
                };

                this.erpNodeDBContext.Profiles.Add(erpProfile);
                this.erpNodeDBContext.SaveChanges();
            }
        }
예제 #2
0
        public void CreateCompanyDB(Models.Company.NewCompanyModel newCompany)
        {
            this.SetFirstDate(newCompany.FirstDate);
            this.CreateSelfProfile(newCompany);

            var defaultAccountsDal = new Repository.Accounting.ChartOfAccountTemplate(this);

            this.ChartOfAccountTemplate.CreateAccounts();
            this.CreateSystemAccounts();
            this.CreateFiscalYear(newCompany);
        }