Exemplo n.º 1
0
    private void bindData()
    {
        string strqry = "SELECT  ID, " +
                        " sfzh,  " +
                        " yourname, " +
                        " xingbie, " +
                        " iif( DateDiff('YYYY', CDate(iif(isnull(birth),now(),iif(birth='',now(),birth)) ), Format(Now(),'yyyy-mm-dd') " +
                        " ) = 0,'', DateDiff('YYYY', CDate(iif(isnull(birth),now(),iif(birth='',now(),birth))),Format(Now(),'yyyy-mm-dd') " +
                        " ) ) AS nianling,   " +
                        " xrzw,  " +
                        " sbzw,  " +
                        " iif (isnull(tj_flag),'未审核',tj_flag) as tuijian, " +
                        " iif(edit_flag,'已提交','未提交') as tijiao, " +
                        " fenlei  " +
                        " FROM cpry  " +
                        " where gzdw = '" + Session["admin_id"].ToString() + "'";


        if (RadioButtonList1.SelectedValue != "all")
        {
            strqry = strqry + " and iif (isnull(tj_flag),'未审核',tj_flag) = '" + RadioButtonList1.SelectedValue + "'";
        }
        strqry = strqry + " ORDER BY ID asc;";
        Session["dv_detail"] = DBFun.GetDataView(strqry);
        DataView dv = (DataView)Session["dv_detail"];

        GridView1.DataSource = dv;
        GridView1.DataBind();

        string          str_sfzh;
        RadioButtonList rbtnList_1;

        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            str_sfzh   = dv.Table.Rows[i + GridView1.PageIndex * GridView1.PageSize]["sfzh"].ToString();
            rbtnList_1 = (RadioButtonList)this.GridView1.Rows[i].FindControl("rbtnList_tjjg");
            rbtnList_1.SelectedValue = dv.Table.Rows[i + GridView1.PageIndex * GridView1.PageSize]["tuijian"].ToString();
        }
        strqry = "select gz , count(gz) as num from " +
                 "( SELECT iif(isnull(csgz),'未填写',csgz) as gz FROM cpry " +
                 " WHERE gzdw =  '" + Session["admin_id"].ToString() + "' and edit_flag = false ";

        if (RadioButtonList1.SelectedValue != "all")
        {
            strqry += " and iif(isnull(tj_flag),'未审核',tj_flag) = '" + RadioButtonList1.SelectedValue + "'";
        }
        strqry += ")  GROUP BY gz;";
        OleDbDataReader reader = DBFun.dataReader(strqry);

        lbl_tongji.Text = "";
        while (reader.Read())
        {
            lbl_tongji.Text = lbl_tongji.Text + reader.GetString(0).ToString() + ":" + reader.GetInt32(1).ToString() + "<br/>";
        }
        DBFun.closeDataReader(ref reader);
    }
Exemplo n.º 2
0
    private void bindData()
    {
        string strqry = "SELECT ID,sfzh, yourname,xingbie, DateDiff('YYYY', CDate(birth),Format(Now(),'yyyy-mm-dd')) AS nianling, xrzw, sbzw, tj_flag,edit_flag,fenlei FROM cpry where edit_flag = false and gzdw = '" + Session["admin_id"].ToString() + "' ";

        if (Session["admin_type"].ToString() == "zhuanjia")
        {
            strqry = "SELECT cpry.id,cpry.sfzh ,yourname,xingbie, DateDiff('YYYY', CDate(birth),Format(Now(),'yyyy-mm-dd')) AS nianling,xrzw,sbzw,tj_flag from cpry,zjry where edit_flag = false and zjid = " + Session["admin_id"].ToString() + " and cpry.sfzh=zjry.sfzh";
        }
        if (RadioButtonList1.SelectedValue != "all")
        {
            strqry = strqry + " and tj_flag = '" + RadioButtonList1.SelectedValue + "'";
        }
        strqry = strqry + " ORDER BY ID;";

        DataView dv = DBFun.GetDataView(strqry);//dv null 为什么

        Session["dv_detail"] = dv;
        GridView1.DataSource = dv;
        GridView1.DataBind();
        //for (int i = 0; i < GridView1.Rows.Count; i++)
        //{
        //    CheckBox ckb = (CheckBox)GridView1.Rows[i].FindControl("ckb_Sle");
        //    ckb.Checked = Convert.ToBoolean(dv.Table.Rows[i + GridView1.PageIndex * GridView1.PageSize]["edit_flag"].ToString());
        //}

        strqry = " SELECT csgz, count(csgz) AS num " +
                 "    FROM cpry " +
                 "   WHERE gzdw = '" + Session["admin_id"].ToString() + "' ";
        if (RadioButtonList1.SelectedValue != "all")
        {
            strqry += " and tj_flag = '" + RadioButtonList1.SelectedValue + "'";
        }
        strqry += " GROUP BY csgz;";
        OleDbDataReader reader = DBFun.dataReader(strqry);

        lbl_tongji.Text = "";
        while (reader.Read())
        {
            lbl_tongji.Text = lbl_tongji.Text + reader.GetString(0).ToString() + ":" + reader.GetInt32(1).ToString() + "<br/>";
        }
        DBFun.closeDataReader(ref reader);
    }
Exemplo n.º 3
0
    protected void bindData_zj()
    {
        string          str_sql  = "select zjid,ryid from zjry where ryid = " + lbl_zjid.Text;
        OleDbDataReader reader   = DBFun.dataReader(str_sql);
        string          str_zjid = "0,";

        while (reader.Read())
        {
            str_zjid = str_zjid + reader["zjid"].ToString() + ",";
        }
        DBFun.closeDataReader(ref reader);
        str_sql = "";
        str_sql = str_sql + " where id in (" + str_zjid + ") ORDER BY ID;";
        Session["dv_zhuanjia"] = DBFun.GetDataView(str_sql);
        DataView dv = (DataView)Session["dv_zhuanjia"];

        gv_zhuanjia.DataSource = dv;
        gv_zhuanjia.DataBind();
        gv_zhuanjia.Visible = true;
    }
Exemplo n.º 4
0
    private void bindData()
    {
        string strqry = "SELECT  ID, " +
                        " sfzh,  " +
                        " yourname, " +
                        " xingbie, " +
                        " iif( DateDiff('YYYY', CDate(iif(isnull(birth),now(),iif(birth='',now(),birth)) ), Format(Now(),'yyyy-mm-dd') " +
                        " ) = 0,'', DateDiff('YYYY', CDate(iif(isnull(birth),now(),iif(birth='',now(),birth))),Format(Now(),'yyyy-mm-dd') " +
                        " ) ) AS nianling,   " +
                        " cplb,  " +
                        " dwtjyj,  " +
                        " iif (isnull(tj_flag),'未审核',tj_flag) as tuijian, " +
                        " iif(edit_flag,'已提交','未提交') as tijiao " +
                        " FROM yxxwlw_cpry  " +
                        " where tjdw = '" + Session["admin_id"].ToString() + "'";


        if (RadioButtonList1.SelectedValue != "all")
        {
            strqry = strqry + " and iif (isnull(tj_flag),'未审核',tj_flag) = '" + RadioButtonList1.SelectedValue + "'";
        }
        strqry = strqry + " ORDER BY ID asc;";
        Session["dv_detail"] = DBFun.GetDataView(strqry);
        DataView dv = (DataView)Session["dv_detail"];

        GridView1.DataSource = dv;
        GridView1.DataBind();

        string          str_sfzh;
        RadioButtonList rbtnList_1;

        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            str_sfzh   = dv.Table.Rows[i + GridView1.PageIndex * GridView1.PageSize]["sfzh"].ToString();
            rbtnList_1 = (RadioButtonList)this.GridView1.Rows[i].FindControl("rbtnList_tjjg");
            rbtnList_1.SelectedValue = dv.Table.Rows[i + GridView1.PageIndex * GridView1.PageSize]["tuijian"].ToString();
        }
        strqry = "select gz , count(gz) as num from " +
                 "( SELECT iif(isnull(csgz),'未填写',csgz) as gz FROM cpry " +
                 " WHERE gzdw =  '" + Session["admin_id"].ToString() + "' and edit_flag = false ";

        if (RadioButtonList1.SelectedValue != "all")
        {
            strqry += " and iif(isnull(tj_flag),'未审核',tj_flag) = '" + RadioButtonList1.SelectedValue + "'";
        }
        strqry += ")  GROUP BY gz;";
        OleDbDataReader reader = DBFun.dataReader(strqry);

        lbl_tongji.Text = "";
        while (reader.Read())
        {
            lbl_tongji.Text = lbl_tongji.Text + reader.GetString(0).ToString() + ":" + reader.GetInt32(1).ToString() + "<br/>";
        }
        DBFun.closeDataReader(ref reader);
        //计算推荐人员人数
        strqry = "SELECT count(*)  FROM yxxwlw_cpry  WHERE tjdw =  '" + Session["admin_id"].ToString() + "' and edit_flag = false  and iif(isnull(tj_flag),'未审核',tj_flag) = '推荐' ";

        string ls_count = DBFun.ExecuteScalar(strqry).ToString();

        this.btn_commit.Attributes.Add("onclick", "return   confirm   (\"拟向中国地震局拟推荐参评人员 " + ls_count + " 位,一旦提交不可修改,确定提交?\");");
    }