Beispiel #1
0
        public ActionResult GetFixtureReport(SportCategoryID SC)
        {
            List<FixturesReport> report = reportRep.GetFixtureReport(SC.SportCategory, SC.Date.Date);
            SportCategoryRepository screp = new SportCategoryRepository();
            StringWriter sw = new StringWriter();
            sw.WriteLine("\"StartTime\",\"TeamA\",\"TeamsB\",\"Field\",\"FixtureId\"");

            string name = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();

            Response.ClearContent();
            Response.AddHeader("content-disposition", "attachment;filename=Fixture" + "_" + name + ".csv");
            Response.ContentType = "text/csv";

            sw.WriteLine("\"Fixtures\"");
            sw.WriteLine(SC.SportCategory);
            sw.WriteLine(SC.Date.Date);

            foreach (FixturesReport ex in report)
            {
                sw.WriteLine(string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\""
                                      , ex.StartTime
                                      , ex.TeamIdA
                                      , ex.TeamIdB
                                      , ex.Field
                                      , ex.FixturesId
                                      ));
            }

            Response.Write(sw.ToString());
            Response.End();
            return null;
        }
Beispiel #2
0
        public ActionResult DoForceUpdate(SportCategoryID SC)
        {
            int ClientId = SC.SportCategory;

            //...Notify...
            string regIds = appRep.GetAllRegIds(ClientId);
            List<string> reg = appRep.GetAllRegIdsList(ClientId);
            if (!regIds.Equals(""))
            {
                comrep.NewsyncData(regIds, "CMD_FORCE_UPDATE", reg, ClientId);
            }
            return RedirectToAction("Home","Home");
        }