Пример #1
0
        //
        // GET: /Report/
        public ActionResult Index()
        {
            HttpCookie cookie    = GetCookie();
            string     userId    = cookie.Values["userId"];
            string     week      = cookie.Values["week"];
            string     isForeign = cookie.Values["isForeign"];

            string whereCondition = " where Week=" + week;

            if (userId != "all")
            {
                whereCondition += " and UserId='" + userId + "' ";
            }
            string whereConditionForeign = whereCondition + " and IsForeign=" + isForeign;
            string limit = " limit 0, " + ConfigurationManager.AppSettings["pageSize"];

            int        c1, c2, c3, c4, c5, p1, p2, p3, p4, p5;
            InitReport initReport = new InitReport();

            //initReport.ReportName = SqlDbHelper.GetReportName(whereCondition);

            initReport.SummaryTargetStrategyList = SqlDbHelper.GetSummaryTargetStrategy(whereConditionForeign, limit, null, out c1, out p1);
            initReport.ProjectInfoList           = SqlDbHelper.GetProjectInfoList(whereConditionForeign, limit, null, out c2, out p2);

            initReport.AffairProductList = SqlDbHelper.GetAffairProduct(whereCondition, limit, null, out c3, out p3);
            initReport.TeamworkInfoList  = SqlDbHelper.GetTeamworkInfoList(whereCondition, limit, null, out c4, out p4);
            initReport.AssistInfoList    = SqlDbHelper.GetAssistInfoList(whereCondition, limit, null, out c5, out p5);
            int[] totalCount = { c1, c2, c3, c4, c5 };
            int[] totalPage  = { p1, p2, p3, p4, p5 };
            initReport.totalCount = totalCount;
            initReport.totalPage  = totalPage;
            ViewBag.UserList      = CacheFoxData.UserList;
            return(PartialView(initReport));
        }
Пример #2
0
        public ActionResult Search(string userId, string week, string isForeign, string project)
        {
            HttpCookie cookie = new HttpCookie("SearchInfo");

            cookie.Values["userId"]    = userId;
            cookie.Values["isForeign"] = isForeign;
            cookie.Values["week"]      = week;
            cookie.Expires             = DateTime.Now.AddDays(30);
            HttpContext.Response.Cookies.Add(cookie);

            ViewBag.SelectedYearWeek  = week;
            ViewBag.SelectedUserId    = userId;
            ViewBag.SelectedIsForeign = isForeign;
            ViewBag.UserList          = CacheFoxData.UserList;
            string whereCondition = " where Week=" + week;

            if (userId != "all")
            {
                whereCondition += " and UserId='" + userId + "' ";
            }
            string whereConditionForeign = whereCondition + " and IsForeign=" + isForeign;
            string whereConditionProject = whereConditionForeign;

            MySqlParameter[] parameters = null;
            if (!string.IsNullOrWhiteSpace(project))
            {
                whereConditionProject += " and ProjectName like @project ";
                parameters             = new MySqlParameter[1];
                parameters[0]          = GetProjectNameParam(project);
            }

            string limit = " limit 0, " + ConfigurationManager.AppSettings["pageSize"];

            int        c1, c2, c3, c4, c5, p1, p2, p3, p4, p5;
            InitReport initReport = new InitReport();

            //initReport.ReportName = SqlDbHelper.GetReportName(whereCondition);

            initReport.SummaryTargetStrategyList = SqlDbHelper.GetSummaryTargetStrategy(whereConditionProject, limit, parameters, out c1, out p1);
            initReport.ProjectInfoList           = SqlDbHelper.GetProjectInfoList(whereConditionProject, limit, parameters, out c2, out p2);

            initReport.AffairProductList = SqlDbHelper.GetAffairProduct(whereCondition, limit, parameters, out c3, out p3);
            initReport.TeamworkInfoList  = SqlDbHelper.GetTeamworkInfoList(whereCondition, limit, parameters, out c4, out p4);
            initReport.AssistInfoList    = SqlDbHelper.GetAssistInfoList(whereCondition, limit, parameters, out c5, out p5);
            int[] totalCount = { c1, c2, c3, c4, c5 };
            int[] totalPage  = { p1, p2, p3, p4, p5 };
            initReport.totalCount = totalCount;
            initReport.totalPage  = totalPage;

            return(PartialView("Index", initReport));
        }
Пример #3
0
 static void AnalyseReport(InitReport report)
 {
     if (!string.IsNullOrEmpty(report.Message))
     {
         Console.WriteLine("Init failed : {0}", report.Message);
     }
     foreach (var componentName in report.ComponentsInitSucceeded)
     {
         Console.WriteLine("Init succeeded : {0}", componentName);
     }
     foreach (var componentName in report.ComponentsInitFailed)
     {
         Console.WriteLine("Init failed : {0}", componentName);
     }
 }