Exemplo n.º 1
0
        public void ShowData()
        {
            this.ReportViewer1.Reset();
            this.ReportViewer1.LocalReport.Dispose();
            this.ReportViewer1.LocalReport.DataSources.Clear();

            Microsoft.Reporting.WebForms.ReportDataSource reportdatsource = new Microsoft.Reporting.WebForms.ReportDataSource();

            reportdatsource.Name = "SolveRpt";

            List <DataEliminate> list   = new List <DataEliminate>();
            List <DataEliminate> dmlist = new List <DataEliminate>();

            if (Session["solvelist"] != null)
            {
                //将session转为集合
                list = (List <DataEliminate>)Session["solvelist"];
                foreach (var v in list)
                {
                    DataEliminate dmm = new DataEliminate();
                    dmm.solveTaskCode = v.solveTaskCode;
                    dmm.solveTaskName = v.solveTaskName;
                    dmm.lineCode      = v.lineCode;
                    dmm.poleCode      = v.poleCode;
                    dmm.startPoleCode = v.startPoleCode;
                    dmm.endPoleCode   = v.endPoleCode;
                    dmm.bugLevelName  = v.bugLevelName;
                    dmm.bugTypeName   = v.bugTypeName;
                    if (v.isBug == 1)
                    {
                        dmm.BugName = "有";
                    }
                    else
                    {
                        dmm.BugName = "无";
                    }
                    dmm.finishTime2   = v.finishTime.ToString();
                    dmm.discoverTime2 = v.discoverTime.ToString();
                    dmm.bugDesc       = v.bugDesc;

                    dmlist.Add(dmm);
                }
            }

            reportdatsource.Value = dmlist;

            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Models/SolveReport.rdlc");

            this.ReportViewer1.LocalReport.DataSources.Add(reportdatsource);

            this.ReportViewer1.LocalReport.Refresh();
        }
Exemplo n.º 2
0
        public ActionResult EliminateCountData()
        {
            var results = (from r in md.ps_solvetask_main
                           join i in md.ps_solvetask_detail
                           on r.id equals i.taskId
                           join p in md.ps_inspectiontask_detail
                           on i.inspectionTaskDelId equals p.id
                           join d in md.ps_inspectiontask_main
                           on p.taskid equals d.id
                           where r.taskStatus == 5 && r.isCancel == 0
                           select new { id = r.id, solveTaskCode = r.solveTaskCode, solveTaskName = r.solveTaskName, lineCode = p.lineCode, startPoleCode = d.startPoleCode, endPoleCode = d.endPoleCode, poleCode = p.poleCode, isBug = p.isBug, bugLevel = p.bugLevelName, bugType = p.bugTypeName, issuedTime = r.issuedTime, discoverTime = p.discoverTime, bugDesc = p.bugDesc });
            List <DataEliminate> delist = new List <DataEliminate>();

            if (results.Count() > 0)
            {
                foreach (var f in results)
                {
                    DataEliminate de = new DataEliminate()
                    {
                        id            = f.id,
                        solveTaskCode = f.solveTaskCode,
                        solveTaskName = f.solveTaskName,
                        lineCode      = f.lineCode,
                        startPoleCode = f.startPoleCode,
                        endPoleCode   = f.endPoleCode,
                        poleCode      = f.poleCode,
                        isBug         = f.isBug,
                        bugLevelName  = f.bugLevel,
                        bugTypeName   = f.bugType,
                        issuedTime    = f.issuedTime,
                        discoverTime  = f.discoverTime,
                        bugDesc       = f.bugDesc
                    };
                    delist.Add(de);
                }
            }
            int       pageindex = int.Parse(Request.Params["pageindex"].ToString());
            int       skip      = (pageindex - 1) * 6;
            DataCount dc        = new DataCount();

            if (delist.Count() > 0)
            {
                dc.plist             = delist.Skip(skip).Take(6).ToList();
                dc.PageCount         = delist.Count();
                Session["solvelist"] = dc.plist;
            }

            string strs = JsonConvert.SerializeObject(dc);

            return(Content(strs));
        }
Exemplo n.º 3
0
        public ActionResult SelectBtn()
        {
            string sovercode = "";
            string sovername = "";
            string isbug     = "";
            string time1     = "";
            string time2     = "";

            int           pageindex = int.Parse(Request.Params["pageindex"]);
            SqlConnection con       = new SqlConnection("server=.;database=MyElectrCheck_DB;Integrated Security=true;");

            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            string sql = "select a.id,a.solveTaskCode,a.solveTaskName,b.lineCode,b.startPoleCode,b.endPoleCode,c.poleCode,c.isBug,c.bugLevelName,c.bugTypeName,a.issuedTime,c.discoverTime,c.bugDesc from ps_solvetask_main a inner join ps_inspectiontask_main b on a.id=b.id inner join ps_inspectiontask_detail c on b.id=c.taskid where 1=1 and a.taskstatus=5 and a.iscancel=0 ";

            if (Request.Params["sovercode"] != "")
            {
                sovercode = Request.Params["sovercode"];
                sql      += " and a.solveTaskCode like '%" + sovercode + "%'";
            }
            if (Request.Params["sovername"] != "")
            {
                sovername = Request.Params["sovername"];
                sql      += "and b.lineCode like '%" + sovername + "%'";
            }
            if (Request.Params["isbug"] != "")
            {
                isbug = Request.Params["isbug"];
                sql  += "and c.isBug =" + isbug + "";
            }
            if (Request.Params["time1"] != "")
            {
                time1 = Request.Params["time1"];
                sql  += "and c.discoverTime >= '" + time1 + "' ";
            }
            if (Request.Params["time2"] != "")
            {
                time2 = Request.Params["time2"];
                sql  += "and c.discoverTime <= '" + time2 + "' ";
            }
            SqlCommand cmd = new SqlCommand(sql, con);

            SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            List <DataEliminate> list = new List <DataEliminate>();

            while (dr.Read())
            {
                DataEliminate del = new DataEliminate()
                {
                    id            = int.Parse(dr["id"].ToString()),
                    solveTaskCode = dr["solveTaskCode"].ToString(),
                    solveTaskName = dr["solveTaskName"].ToString(),
                    lineCode      = dr["lineCode"].ToString(),
                    startPoleCode = dr["startPoleCode"].ToString(),
                    endPoleCode   = dr["endPoleCode"].ToString(),
                    poleCode      = dr["poleCode"].ToString(),
                    isBug         = int.Parse(dr["isBug"].ToString()),
                    bugLevelName  = dr["bugLevelName"].ToString(),
                    bugTypeName   = dr["bugTypeName"].ToString(),
                    issuedTime    = DateTime.Parse(dr["issuedTime"].ToString()),
                    discoverTime  = DateTime.Parse(dr["discoverTime"].ToString()),
                    bugDesc       = dr["bugDesc"].ToString()
                };
                list.Add(del);
            }

            dr.Close();
            con.Close();

            int       skip = (pageindex - 1) * 6;
            DataCount ds   = new DataCount();

            ds.plist             = list.Skip(skip).Take(6).ToList();
            ds.PageCount         = list.Count();
            Session["solvelist"] = ds.plist;
            string strs = JsonConvert.SerializeObject(ds);;

            return(Content(strs));
        }