Пример #1
0
    private void bindData()
    {
        string strqry = "select iif(isnull(fs_pjys_sum),'0',fs_pjys_sum) as fs_sum,zj_sfzh,cpry_sfzh,jypj,UserName,zjdm,iif(isnull(fs_pjys_sum),'否','是') as sfpj from zjry,pszj where sfzh = zj_sfzh and zjry.flag = 1 ";

        strqry = strqry + " and cpry_sfzh = '" + Session["sfzh"].ToString() + "'";
        Session["dv_zj_pingfen"] = DBFun.GetDataView(strqry);
        DataView dv = (DataView)Session["dv_zj_pingfen"];

        GridView1.DataSource = dv;
        GridView1.DataBind();
        lbl_sum.Text = "得分:" + PrivateFun.Get_Score_zj(dv);

        GridView1.ShowFooter            = true;
        GridView1.Columns[2].FooterText = lbl_sum.Text;

        //strqry = " select gz,count(gz) as num from " +
        //        " (SELECT iif(isnull(csgz),'未填写',csgz) as gz" +
        //        " FROM cpry ,t_dict" +
        //        " WHERE url = gzdw and t_dict.tj_flag = true and edit_flag = false and cpry.tj_flag = '推荐'";

        //if (RadioButtonList1.SelectedValue != "all")
        //    strqry = strqry + " and sh_flag = '" + RadioButtonList1.SelectedValue + "'";
        //strqry = 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);
    }
Пример #2
0
    protected void btn_SaveToWord_Click(object sender, EventArgs e)
    {
        string   sourcefile = Server.MapPath("templete/erji.doc");
        Document doc        = new Document(sourcefile); //载入模板

        PrivateFun.SetInfoIntoWrod_erji(doc, Session["sfzh"].ToString());

        doc.Save(Server.MapPath("./exporttopdf/") + Session["sfzh"].ToString() + ".doc", SaveFormat.Doc); //保存为doc,并打开
        Response.Redirect("./exporttopdf/default.aspx?sfzh=" + Session["sfzh"].ToString());
    }
Пример #3
0
    protected void lbtn_dyyl_Click(object sender, EventArgs e)
    {
        string   sourcefile;
        Document doc;

        sourcefile = Server.MapPath("./templete/jy.doc");
        doc        = new Document(sourcefile);                                                                                       //载入模板
        PrivateFun.SetInfoIntoWrod_jy(doc, Session["appNo"].ToString());
        doc.Save(Server.MapPath("./exporttopdf/") + Session["jsm"].ToString() + Session["jsh"].ToString() + ".doc", SaveFormat.Doc); //保存为doc,并打开
        Response.Redirect("./exporttopdf/" + Session["jsm"].ToString() + Session["jsh"].ToString() + ".doc");
    }
Пример #4
0
    protected void bindData()
    {
        string   sourcefile;
        Document doc;

        sourcefile = Server.MapPath("./templete/jy.doc");
        doc        = new Document(sourcefile);                                                                                             //载入模板
        PrivateFun.SetInfoIntoWrod_1(doc, Session["jsh"].ToString());
        doc.Save(Server.MapPath("./exporttopdf/") + Session["jsm"].ToString() + " " + Session["jsh"].ToString() + ".doc", SaveFormat.Doc); //保存为doc,并打开
        Response.Redirect("./exporttopdf/" + Session["jsm"].ToString() + " " + Session["jsh"].ToString() + ".doc");
    }
Пример #5
0
    protected void btn_SaveToWord_Click(object sender, EventArgs e)
    {
        string   sourcefile;
        Document doc;

        sourcefile = Server.MapPath("./templete/tt_zjtpb.doc");
        doc        = new Document(sourcefile); //载入模板
        PrivateFun.SetInfoIntoWrod_tetie_zjtpb(doc, str_zjid);


        doc.Save(Server.MapPath("./exporttopdf/") + str_zjid + ".doc", SaveFormat.Doc); //保存为doc,并打开
        Response.Redirect("./exporttopdf/" + str_zjid + ".doc");
    }
Пример #6
0
    protected void btn_calc_Click(object sender, EventArgs e)
    {
        string str_sql = "alter table cpry add column score_xmrw numeric,score_lzbg numeric,score_yjcg numeric";

        try { DBFun.ExecuteSql(str_sql); }
        catch { }

        str_sql = "select sfzh,sbzw from cpry,t_dict " +
                  "where url=gzdw and edit_flag=false and cpry.tj_flag='推荐' and sh_flag='通过' and t_dict.tj_flag=true  order by gzdw asc, ID asc;";
        DataView dv = DBFun.dataView(str_sql);
        DataView dv_zj;

        for (int i = 0; i < dv.Table.Rows.Count; i++)
        {
            Session["sfzh"] = dv.Table.Rows[i]["sfzh"].ToString();
            string str_score = "";
            if (dv.Table.Rows[i]["sbzw"].ToString() == "研究员")
            {
                str_score = GetScore_yjy();
            }
            else
            {
                str_score = GetScore_gg();
            }
            string str_s1, str_s2, str_s3, str_s4;
            str_s1 = str_score.Substring(0, str_score.IndexOf(","));
            str_s2 = str_score.Substring(str_score.IndexOf(",") + 1, str_score.LastIndexOf(",") - str_score.IndexOf(",") - 1);
            str_s3 = str_score.Substring(str_score.LastIndexOf(",") + 1);
            //计算专家评分
            string strqry = "select iif(isnull(fs_pjys_sum),'0',fs_pjys_sum) as fs_sum,zj_sfzh,cpry_sfzh,jypj,UserName,zjdm,iif(isnull(fs_pjys_sum),'否','是') as sfpj from zjry,pszj where sfzh = zj_sfzh and pszj.flag = 1 ";
            strqry = strqry + " and cpry_sfzh = '" + dv.Table.Rows[i]["sfzh"].ToString() + "'";
            dv_zj  = DBFun.GetDataView(strqry);
            str_s4 = PrivateFun.Get_Score_zj(dv_zj);

            str_sql = "update cpry set score_xmrw = " + str_s1 + ",score_lzbg=" + str_s2 + ",score_yjcg=" + str_s3 + ",score_zj=" + str_s4 + " where sfzh = '" + Session["sfzh"].ToString() + "';";
            if (!DBFun.ExecuteUpdate(str_sql))
            {
                Response.Write("<script>alert('计算分数失败,请重新计算!');</script>");
                return;
            }
        }
        Response.Write("<script>alert('计算分数成功!');</script>");
    }
Пример #7
0
    protected void lbtn_PrintPreview_Click(object sender, EventArgs e)
    {
        string   sourcefile;
        string   str_sql  = "select sbzw from cpry where sfzh='" + Session["sfzh"].ToString() + "'";
        string   str_sbzw = DBFun.ExecuteScalar(str_sql).ToString();
        Document doc;

        if (str_sbzw == "研究员")
        {
            sourcefile = Server.MapPath("templete/yjy.doc");
            doc        = new Document(sourcefile); //载入模板
            PrivateFun.SetInfoIntoWrod_yjy(doc, Session["sfzh"].ToString());
        }
        else
        {
            sourcefile = Server.MapPath("templete/zyjgg.doc");
            doc        = new Document(sourcefile); //载入模板
            PrivateFun.SetInfoIntoWrod_zyjgg(doc, Session["sfzh"].ToString());
        }

        doc.Save(Server.MapPath("./exporttopdf/") + Session["sfzh"].ToString() + ".doc", SaveFormat.Doc); //保存为doc,并打开
        Response.Redirect("./exporttopdf/default.aspx?sfzh=" + Session["sfzh"].ToString());
    }