Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISeedData seedData)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
                       routes.MapRoute(
                           name: "WebAPI",
                           template: "api/{controller}/{action}/{id?}"
                           )
                       //.MapRoute(
                       //    name: "WebAPIForYear",
                       //    template: "api/foryear/{year:int}/{controller}/{action}/{id?}"
                       //)
                       );

            seedData.SeedUserData();
            //var tmp1 = UnitOfWork.ContoShemeOptions;
            //seedData.SeedCompanyData();

            //seedData.PopulateData();
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISeedData seedData)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseSignalR((cfg) => {
                cfg.MapHub <NotificationHub>("/notifications");
            });

            app.UseMvc(routes =>
                       routes.MapRoute(
                           name: "WebAPI",
                           template: "api/{controller}/{action}/{id?}"
                           )
                       //.MapRoute(
                       //    name: "WebAPIForYear",
                       //    template: "api/foryear/{year:int}/{controller}/{action}/{id?}"
                       //)
                       );

            seedData.SeedCompanyData();
            seedData.SeedUserData();
            //var tmp1 = UnitOfWork.ContoShemeOptions;

            //seedData.PopulateData();

            // Create views
            BankView.CreateView();

            BusinessPartnerBankView.CreateView();
            BusinessPartnerByConstructionSiteView.CreateView();
            BusinessPartnerInstitutionView.CreateView();
            BusinessPartnerLocationView.CreateView();
            BusinessPartnerDocumentView.CreateView();
            BusinessPartnerNoteView.CreateView();
            BusinessPartnerOrganizationUnitView.CreateView();
            BusinessPartnerPhoneView.CreateView();
            BusinessPartnerView.CreateView();
            BusinessPartnerTypeView.CreateView();

            //CompanyView.CreateView(); //???

            //UserView.CreateView();

            InputInvoiceView.CreateView();
            InputInvoiceNoteView.CreateView();
            InputInvoiceDocumentView.CreateView();
            OutputInvoiceDocumentView.CreateView();
            OutputInvoiceView.CreateView();
            OutputInvoiceNoteView.CreateView();

            CountryView.CreateView();
            RegionView.CreateView();
            MunicipalityView.CreateView();
            CityView.CreateView();

            ProfessionView.CreateView();

            SectorView.CreateView();
            AgencyView.CreateView();

            TaxAdministrationView.CreateView();

            ToDoView.CreateView();

            EmployeeByBusinessPartnerView.CreateView();
            EmployeeByConstructionSiteView.CreateView();
            EmployeeCardView.CreateView();
            EmployeeView.CreateView();
            EmployeeDocumentView.CreateView();
            EmployeeItemView.CreateView();
            EmployeeLicenceView.CreateView();
            EmployeeNoteView.CreateView();
            EmployeeProfessionView.CreateView();
            FamilyMemberView.CreateView();
            LicenceTypeView.CreateView();

            PhysicalPersonView.CreateView();
            PhysicalPersonItemView.CreateView();
            PhysicalPersonNoteView.CreateView();
            PhysicalPersonLicenceView.CreateView();
            PhysicalPersonDocumentView.CreateView();
            PhysicalPersonCardView.CreateView();
            PhysicalPersonProfessionView.CreateView();

            ConstructionSiteCalculationView.CreateView();
            ConstructionSiteDocumentView.CreateView();
            ConstructionSiteNoteView.CreateView();
            ConstructionSiteView.CreateView();

            VatView.CreateView();

            ServiceDeliveryView.CreateView();
            DiscountView.CreateView();
            StatusView.CreateView();

            ShipmentView.CreateView();
            ShipmentDocumentView.CreateView();

            PhonebookView.CreateView();
            PhonebookDocumentView.CreateView();
            PhonebookNoteView.CreateView();
            PhonebookPhoneView.CreateView();

            InvoiceView.CreateView();
            InvoiceItemView.CreateView();

            CallCentarView.CreateView();

            CalendarAssignmentView.CreateView();

            EmployeeAttachmentView.CreateView();

            PhysicalPersonAttachmentView.CreateView();

            ToDoStatusView.CreateView();

            var mailingTime = new Config().GetConfiguration()["MailTime"];

            Console.WriteLine("Sending mails scheduled at: {0}\nCurrent time: {1}", mailingTime, DateTime.Now.ToString("HH:mm:ss"));

            Thread mailThread = new Thread(() => MailTask.SendMailTime(mailingTime));

            mailThread.IsBackground = true;
            mailThread.Start();
        }