Ejemplo n.º 1
0
        private void BarMonthTasknumber(HttpContext context)
        {
            BLL.ChartReport bll     = new BLL.ChartReport();
            string          strYear = context.Request["Year"];

            if (string.IsNullOrEmpty(strYear))
            {
                strYear = DateTime.Now.Year.ToString();
            }
            DataSet ds = bll.BarMonthTasknumber(strYear);
            List <Model.ChartReport.MonthData> list = new List <Model.ChartReport.MonthData>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.ChartReport.MonthData()
                {
                    Month        = Convert.ToInt32(dr["CR_Month"]),
                    DataPreMonth = Convert.ToInt32(dr["CR_TaskNumber"])
                });
            }
            //for (int i = 0; i < 12; i++)
            //{
            //   Model.ChartReport list.Find()

            //}
            //list.Sort();
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);

            context.Response.Write(strJson);
        }
Ejemplo n.º 2
0
        private void LineMonthBugnoRelease(HttpContext context)
        {
            BLL.ChartReport bll  = new BLL.ChartReport();
            string          Year = context.Request["Year"];

            if (string.IsNullOrEmpty(Year))
            {
                Year = DateTime.Now.Year.ToString();
            }
            DataSet ds = bll.LineMonthBugnoRelease(Year);
            List <Model.ChartReport.LabelReleaseData> list = new List <Model.ChartReport.LabelReleaseData>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.ChartReport.LabelReleaseData()
                {
                    LabelName = dr["MonthNum"].ToString(),
                    Release   = dr["TT_Release"].ToString(),
                    iData     = Convert.ToInt32(dr["IssueNo"])
                });
            }
            string[] arrRelease = { "W14", "W15", "W16", "LM" };
            Model.ChartReport.LabelReleaseData modelCheck;
            for (int i = 1; i <= 12; i++)
            {
                foreach (string Release in arrRelease)
                {
                    modelCheck = list.Find(delegate(Model.ChartReport.LabelReleaseData model)
                    {
                        return(model.LabelName == i.ToString() && model.Release == Release);
                    });
                    if (modelCheck == null)
                    {
                        list.Add(new Model.ChartReport.LabelReleaseData()
                        {
                            LabelName = i.ToString(),//.Length == 1 ? '0' + i.ToString() : i.ToString()
                            Release   = Release,
                            iData     = 0
                        });
                    }
                }
            }

            list = list.OrderBy(o => o.LabelName.PadLeft(2, '0')).ThenBy(o => o.Release).ToList();
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);

            context.Response.Write(strJson);
        }
Ejemplo n.º 3
0
        private void PieResolutionBugno(HttpContext context)
        {
            BLL.ChartReport bll         = new BLL.ChartReport();
            string          Year        = context.Request["Year"];
            string          Season      = context.Request["Season"];
            string          strDateTime = GetDateTimeWithYearSeasonNum(Year, Season);
            DataSet         ds          = bll.PieResolutionBugno(strDateTime);
            List <Model.ChartReport.LabelDataPercent> list = new List <Model.ChartReport.LabelDataPercent>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.ChartReport.LabelDataPercent()
                {
                    LabelName = dr["BI_Resolution"].ToString(),
                    iData     = Convert.ToInt32(dr["BugNo"]),
                    Percent   = Convert.ToInt32(dr["BugPercent"].ToString() == "" ? 0 : dr["BugPercent"]).ToString() + '%'
                });
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);

            context.Response.Write(strJson);
        }
Ejemplo n.º 4
0
        private void BarTaskstyleCaseno(HttpContext context)
        {
            BLL.ChartReport bll         = new BLL.ChartReport();
            string          strYear     = context.Request["Year"];
            string          strSeason   = context.Request["Season"];
            string          strDateTime = GetDateTimeWithYearSeasonNum(strYear, strSeason);

            DataSet ds = bll.BarTaskstyleCaseno(strDateTime);
            List <Model.ChartReport.LabelData> list = new List <Model.ChartReport.LabelData>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.ChartReport.LabelData()
                {
                    LabelName = dr["TaskType"].ToString(),
                    iData     = Convert.ToInt32(dr["CaseNo"])
                });
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);

            context.Response.Write(strJson);
        }