private void QueryTaskListTotal(HttpContext context)
        {
            BLL.TaskTotal bll     = new BLL.TaskTotal();
            string        keyWord = context.Request["keyWord"];
            DataSet       ds      = new DataSet();

            if (keyWord == "OnlyHaveScenario")
            {
                ds = bll.GetList("TT_HaveScenario='Yes'");
            }
            else
            {
                ds = bll.GetList("");
            }

            List <Model.TaskTotalForDisplay> list = new List <Model.TaskTotalForDisplay>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.TaskTotalForDisplay()
                {
                    TT_ID    = Convert.ToInt32(dr["TT_ID"]),
                    TT_Title = dr["TT_Title"].ToString(),
                    //TT_Release = dr["TT_Release"].ToString(),
                    //TT_CU = dr["TT_CU"].ToString(),
                    //TT_BuildType = dr["TT_BuildType"].ToString(),
                    //TT_BuildNum = dr["TT_BuildNum"].ToString(),
                    //TT_TaskType = dr["TT_TaskType"].ToString(),
                    //TT_CaseTotalNum = dr["TT_CaseTotalNum"].ToString(),
                    //TT_CaseRealRunNum = dr["TT_CaseRealRunNum"].ToString(),
                    //TT_Date = ((DateTime)dr["TT_DateStart"]).ToString("dd/MM/yyyy") + " - " + ((DateTime)dr["TT_DateEnd"]).ToString("dd/MM/yyyy"),
                    TT_Date      = Convert.ToDateTime(dr["TT_DateStart"]).ToString("dd/MM/yyyy") + " - " + Convert.ToDateTime(dr["TT_DateEnd"]).ToString("dd/MM/yyyy"),
                    TT_TaskStyle = dr["TT_TaskStyle"].ToString(),
                    //TT_BugIssueNum = dr["TT_BugIssueNum"].ToString(),
                    //TT_ReportLink = dr["TT_ReportLink"].ToString(),
                    //TT_Comments = dr["TT_Comments"].ToString(),
                    TT_HaveScenario = dr["TT_HaveScenario"].ToString(),
                    //TT_CreateDate = ((DateTime)dr["TT_CreateDate"]).ToString("yyyy-MM-dd HH:mm:ss")
                    TT_TaskProgress = dr["TT_TaskProgress"].ToString() + "%",
                    TT_TaskStatus   = dr["TT_TaskStatus"].ToString()
                });
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = string.Format("{{\"rows\":{0}}}", jss.Serialize(list));

            context.Response.Write(strJson);
        }
        private void GetDDLTaskTotalSearch(HttpContext context)
        {
            BLL.TaskTotal bll        = new BLL.TaskTotal();
            DataSet       ds         = new DataSet();
            string        strKeyWord = context.Request["keyword"];

            if (!string.IsNullOrEmpty(strKeyWord))
            {
                if (strKeyWord == "InProgress")
                {
                    ds = bll.GetList("TT_TaskStatus='InProgress'");
                }
                else
                {
                    ds = bll.GetList("TT_Title like '%" + strKeyWord + "%'");
                }
            }
            else
            {
                ds = bll.GetList("TT_TaskStatus='InProgress'");
            }
            List <Model.TaskTotalForDLL> list = new List <Model.TaskTotalForDLL>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.TaskTotalForDLL()
                {
                    TT_ID         = Convert.ToInt32(dr["TT_ID"]),
                    TT_Title      = dr["TT_Title"].ToString(),
                    TT_TaskStatus = dr["TT_TaskStatus"].ToString()
                });
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);

            context.Response.Write(strJson);
        }
        private void GetDDLTaskTotalInprogress(HttpContext context)
        {
            BLL.TaskTotal bll = new BLL.TaskTotal();
            DataSet       ds  = bll.GetList("TT_TaskStatus='InProgress'");
            List <Model.TaskTotalForDLL> list = new List <Model.TaskTotalForDLL>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.TaskTotalForDLL()
                {
                    TT_ID    = Convert.ToInt32(dr["TT_ID"]),
                    TT_Title = dr["TT_Title"].ToString()
                });
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);//.TrimStart('[').TrimEnd(']');

            context.Response.Write(strJson);
        }
        private void QueryTaskListTotalSimple(HttpContext context)
        {
            BLL.TaskTotal bll                     = new BLL.TaskTotal();
            int           ListItemNum             = Convert.ToInt32(context.Request["ListItemNum"]);
            string        keyWord                 = context.Request["keyWord"];
            DataSet       ds                      = bll.GetList(ListItemNum, string.Format("TT_Title like '%{0}%'", keyWord));
            List <Model.TaskTotalForDisplay> list = new List <Model.TaskTotalForDisplay>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                list.Add(new Model.TaskTotalForDisplay()
                {
                    TT_ID         = Convert.ToInt32(dr["TT_ID"]),
                    TT_Title      = dr["TT_Title"].ToString(),
                    TT_Date       = Convert.ToDateTime(dr["TT_DateStart"]).ToString("dd/MM/yyyy") + " - " + Convert.ToDateTime(dr["TT_DateEnd"]).ToString("dd/MM/yyyy"),
                    TT_TaskStatus = dr["TT_TaskStatus"].ToString()
                });
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string strJson           = jss.Serialize(list);

            context.Response.Write(strJson);
        }