コード例 #1
0
        public ActionResult Index(CriteriaModel model)
        {
            if (ModelState.IsValid)
            {
                ISystemDataProvider SystemDataProvider = new SystemDataProvider(ConfigurationManager.ConnectionStrings["IrmDbContext"].ConnectionString);
                List<char> genders = new List<char>();
                if (model.Females)
                {
                    genders.Add('F');
                }

                if (model.Males)
                {
                    genders.Add('M');
                }

                if (model.Unknowns)
                {
                    genders.Add('U');
                }

                List<string> zipCodes = model.ZipCodes.Split(',').ToList();
                if (zipCodes.Count == 0)
                {
                    zipCodes.Add(model.ZipCodes);
                }
                    DataTable t = SystemDataProvider.MailingListCounts(zipCodes, genders, model.MinAge, model.MaxAge, model.MinIncome, model.MaxIncome );
                // model.RowCount = DateTime.Now.Second;
                model.RowCount = t.Rows.Count;
            }
            return View(model);
        }
コード例 #2
0
        //public void Application_End(object sender, EventArgs e)
        //{
        //    //  Code that runs on application shutdown
        //}

        //public void Application_Error(object sender, EventArgs e)
        //{
        //    // Code that runs when an unhandled error occurs
        //}

        protected void Session_Start(object sender, EventArgs e)
        // Code that runs when a new session is started
        {
            ISystemDataProvider SystemDataProvider = new SystemDataProvider(ConfigurationManager.ConnectionStrings["IrmDBContext"].ConnectionString);
            SystemDataProvider.ChangeHealthCareSystem(Convert.ToInt32(ConfigurationManager.AppSettings["HealthSystemID"].ToString()));
            var userViewModel = new IRM.Web.ViewModel.UserViewModel(SystemDataProvider);
            Session.Add("UserViewModel", userViewModel);
            Session.Add("HealthCareSystemId", userViewModel.HealthCareSystemId);
            Session.Add("SystemDataProvider", SystemDataProvider);

             System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
             System.Reflection.AssemblyName assemblyName = assembly.GetName();
             Version version = assemblyName.Version;
             Session.Add("SiteVersion", version);

            //Must be created after userViewModel so Session["HealthcareSystemId"] gets set.
            var reportsVM = new IRM.Web.ViewModel.ReportsViewModel(new IRMReportDataProvider(SystemDataProvider),SystemDataProvider);
            reportsVM.GeographicViewmodel.HealthcareSystemId = userViewModel.HealthCareSystemId;//Set the HealthSystemID
            Session.Add("ReportsViewmodel", reportsVM);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            int TimerInterval = Convert.ToInt32(ConfigurationManager.AppSettings["TimerInterval"]);
            string UserName = ConfigurationManager.AppSettings["UserName"];
            string Password = ConfigurationManager.AppSettings["Password"];
            ISystemDataProvider IrmDbDataProvider = new SystemDataProvider(ConfigurationManager.ConnectionStrings["IrmDBContext"].ConnectionString);
            HostFactory.Run(x =>
                {
                    x.Service<ServiceImport>(s =>
                        {
                            s.ConstructUsing(name => new ServiceImport(IrmDbDataProvider,TimerInterval));
                            s.WhenStarted(y => y.Start());
                            s.WhenStopped(y => y.Stop());
                        });
                    
                    x.RunAs(UserName, Password);

                    x.SetDescription(String.Format("Data Platform {0} Service", ServiceType));
                    x.SetDisplayName(String.Format("DP.{0}", ServiceType));
                    x.SetServiceName(String.Format("DP.{0}", ServiceType));
                });
        }