示例#1
0
    //绑定待复查隐患
    private void bindYH(decimal[] place)
    {
        var query = from a in dc.Getyhinput
                    where a.Status == "隐患已整改" && place.Contains(a.Placeid.Value) && a.Unitid == SessionBox.GetUserSession().DeptNumber
                    orderby a.Placename
                    select
                    new
        {
            BanCi    = a.Banci,
            DeptName = a.Deptname,
            INTime   = a.Intime,
            a.Name,
            PCTime    = a.Pctime,
            PlaceName = a.Placename,
            Remarks   = a.Remarks,
            YHContent = a.Yhcontent,
            YHLevel   = a.Levelname,
            YHType    = a.Typename,
            YHPutinID = a.Yhputinid
        };

        YHStore.DataSource = query;
        YHStore.DataBind();
        btnExcel.Disabled = query.Count() > 0 ? false : true;
        btnPrint.Disabled = query.Count() > 0 ? false : true;
    }
示例#2
0
    private void StoreLoad()
    {
        var data = from yh in dc.Swbase
                   from c in dc.CsBaseinfoset
                   from d in dc.CsBaseinfoset
                   where yh.Levelid == c.Infoid && yh.Typeid == d.Infoid && yh.Nstatus == 2
                   select new
        {
            yh.Swid,
            yh.Swnumber,
            yh.Swcontent,
            yh.Levelid,
            Levelname = c.Infoname,
            yh.Typeid,
            Typename = d.Infoname,
            yh.Conpyfirst,
            yh.Intime,
            yh.Nstatus,
            y2h = dc.Shmatchup.Count(ym => ym.Swid == yh.Swid) == 0 ? "否" : "是"
        };

        if (df_begin.SelectedValue != null)
        {
            data = data.Where(p => p.Intime >= df_begin.SelectedDate);
        }
        if (df_end.SelectedValue != null)
        {
            data = data.Where(p => p.Intime <= df_end.SelectedDate);
        }
        if (cbb_lavel.SelectedIndex > -1)
        {
            data = data.Where(p => p.Levelid == decimal.Parse(cbb_lavel.SelectedItem.Value));
        }
        if (cbb_kind.SelectedIndex > -1)
        {
            data = data.Where(p => p.Typeid == decimal.Parse(cbb_kind.SelectedItem.Value));
        }
        if (tf_Yhconcent.Text.Trim() != "")
        {
            data = data.Where(p => p.Swcontent.Contains(tf_Yhconcent.Text.Trim()));
        }
        //data = data.Where(p => p.y2h == "是");
        YHStore.DataSource = data;
        YHStore.DataBind();
    }
示例#3
0
    private void StoreLoad()
    {
        var datayh = from yh in dc.Swbase
                     from d in dc.CsBaseinfoset
                     where yh.Typeid == d.Infoid && yh.Nstatus == 2
                     select new
        {
            yh.Swid,
            yh.Swnumber,
            yh.Swcontent,
            yh.Levelid,
            yh.Typeid,
            Typename = d.Infoname,
            yh.Conpyfirst,
            yh.Intime,
            yh.Nstatus
        };
        var data2 = from d in datayh
                    join yq in dc.Swquote.Where(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber) on d.Swid equals yq.Swid into gg
                    from g in gg.DefaultIfEmpty()
                    select new
        {
            d.Swid,
            d.Swnumber,
            d.Swcontent,
            Levelid = (g == null ? d.Levelid : g.Levelid),
            d.Typeid,
            d.Typename,
            d.Conpyfirst,
            Intime  = g.Quotetime,
            Nstatus = g == null ? 2 : g.Nstatus
        };

        var data = from d in data2
                   from c in dc.CsBaseinfoset
                   where d.Levelid == c.Infoid
                   select new
        {
            d.Swid,
            d.Swnumber,
            d.Swcontent,
            d.Levelid,
            Levelname = c.Infoname,
            d.Typeid,
            d.Typename,
            d.Conpyfirst,
            d.Intime,
            d.Nstatus
        };

        if (cbb_lavel.SelectedIndex > -1)
        {
            data = data.Where(p => p.Levelid == decimal.Parse(cbb_lavel.SelectedItem.Value));
        }
        if (cbb_kind.SelectedIndex > -1)
        {
            data = data.Where(p => p.Typeid == decimal.Parse(cbb_kind.SelectedItem.Value));
        }
        YHStore.DataSource = data;
        YHStore.DataBind();
    }
示例#4
0
    private void StoreLoad()
    {
        var data1 = from yh in dc.Yhbase
                    from c in dc.CsBaseinfoset
                    from d in dc.CsBaseinfoset
                    from e in dc.Department
                    where yh.Levelid == c.Infoid && yh.Typeid == d.Infoid && e.Deptnumber == yh.Submitdept
                    select new
        {
            yh.Yhid,
            yh.Yhnumber,
            yh.Yhcontent,
            yh.Levelid,
            Levelname = c.Infoname,
            yh.Typeid,
            Typename = d.Infoname,
            yh.Conpyfirst,
            yh.Intime,
            yh.Nstatus,
            yh.Sglxid,
            e.Deptname
        };

        var data = from d in data1
                   join e in dc.CsBaseinfoset on d.Sglxid equals e.Infoid into gg
                   from g in gg.DefaultIfEmpty()
                   select new
        {
            d.Yhid,
            d.Yhnumber,
            d.Yhcontent,
            d.Levelid,
            d.Levelname,
            d.Typeid,
            d.Typename,
            d.Conpyfirst,
            d.Intime,
            d.Nstatus,
            d.Sglxid,
            d.Deptname,
            Sglxname = g.Infoname == null?"":g.Infoname
        };


        if (df_begin.SelectedValue != null)
        {
            data = data.Where(p => p.Intime >= df_begin.SelectedDate);
        }
        if (df_end.SelectedValue != null)
        {
            data = data.Where(p => p.Intime <= df_end.SelectedDate);
        }
        if (cbb_lavel.SelectedIndex > -1)
        {
            data = data.Where(p => p.Levelid == decimal.Parse(cbb_lavel.SelectedItem.Value));
        }
        if (cbb_kind.SelectedIndex > -1)
        {
            data = data.Where(p => p.Typeid == decimal.Parse(cbb_kind.SelectedItem.Value));
        }
        if (cbb_status.SelectedIndex > -1)
        {
            data = data.Where(p => p.Nstatus == decimal.Parse(cbb_status.SelectedItem.Value));
        }
        if (cbb_SG.SelectedIndex > -1)
        {
            data = data.Where(p => p.Sglxid == decimal.Parse(cbb_SG.SelectedItem.Value));
        }
        YHStore.DataSource = data;
        YHStore.DataBind();
    }