コード例 #1
0
        public static Entity.GaoKaoCard GaoKaoCardEntityGetByStudentId(int StudentId)
        {
            Entity.GaoKaoCard info = new Entity.GaoKaoCard();
            DataTable         dt   = SqlDB.ExecuteDataset(CommandType.Text, "SELECT * FROM [GaoKaoCard] WHERE StudentId = '" + StudentId + "'").Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.ID               = Basic.Utils.StrToInt(dt.Rows[0]["ID"].ToString(), 0);
                info.KaHao            = dt.Rows[0]["KaHao"].ToString();
                info.MiMa             = dt.Rows[0]["MiMa"].ToString();
                info.StudentId        = Basic.Utils.StrToInt(dt.Rows[0]["StudentId"].ToString(), 0);
                info.ProvinceId       = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0);
                info.Belong           = Basic.Utils.StrToInt(dt.Rows[0]["Belong"].ToString(), 0);
                info.DianId           = Basic.Utils.StrToInt(dt.Rows[0]["DianId"].ToString(), 0);
                info.CardLevel        = Basic.Utils.StrToInt(dt.Rows[0]["CardLevel"].ToString(), 0);
                info.IsPause          = Basic.Utils.StrToInt(dt.Rows[0]["IsPause"].ToString(), 0);
                info.AllowChangeCount = Basic.Utils.StrToInt(dt.Rows[0]["AllowChangeCount"].ToString(), 0);
                info.HaveChangeCount  = Basic.Utils.StrToInt(dt.Rows[0]["HaveChangeCount"].ToString(), 0);
                info.Memo             = dt.Rows[0]["Memo"].ToString();
                info.DingDanHao       = dt.Rows[0]["DingDanHao"].ToString();

                info.EndTime      = Basic.TypeConverter.StrToDateTime(dt.Rows[0]["DingDanHao"].ToString());
                info.RegisterDate = Basic.TypeConverter.StrToDateTime(dt.Rows[0]["RegisterDate"].ToString());

                return(info);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
ファイル: default.aspx.cs プロジェクト: srsman/gaokao2015
        protected void Page_Load(object sender, EventArgs e)
        {
            if (userinfo.StudentLevel > 1 && userinfo.StudentLevel < 9)
            {
                Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByKaHao(userinfo.Bank);
                if (info != null)
                {
                    if (info.IsArt == 1)
                    {
                        if (DAL.YKStudentXinXi.YKStudentXinXiCount("GaoKaoKaHao = '" + info.KaHao + "'") == 0)
                        {
                            bYKStudentXinXi = 1;
                            Bank            = info.KaHao;
                        }
                    }
                }
            }

            lit_ProvinceName.Text   = DAL.Common.GetProvinceName(userinfo.ProvinceId);
            lit_KeLeiMingCheng.Text = DAL.Common.GetKeLeiMingCheng(userinfo.KeLei);
            lit_LevelName.Text      = DAL.Common.GetLevelName(userinfo.StudentLevel);
            lit_NianJi.Text         = DAL.Common.GetStudentClass(userinfo.GKYear);
            lit_GKYear.Text         = userinfo.GKYear.ToString();

            int intGender = DAL.Join_Student.Join_StudentEntityGet(userinfo.StudentId).Sex;

            if (intGender == 1)
            {
                strGender = "nv";
            }
            else
            {
                strGender = "nan";
            }
        }
コード例 #3
0
        void Bind()
        {
            hidKeLei.Value = userinfo.KeLei.ToString();

            Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByStudentId(userinfo.StudentId);
            if (info != null)
            {
                //ltlTiXing3.Text = "提醒:您可以设定" + info.AllowChangeCount + "次成绩修改机会,已经设定" + info.HaveChangeCount + "次,还有" + (info.AllowChangeCount - info.HaveChangeCount) + "次设定机会";
            }
        }
コード例 #4
0
ファイル: Dian.cs プロジェクト: srsman/gaokao2015
        void page_Loading(object sender, EventArgs e)
        {
            int intStudentId = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentId"), 0);

            Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByStudentId(intStudentId);
            if (info != null)
            {
                if (info.DianId > 0)
                {
                    Basic.CookieHelper.WriteCookie("dian", "ok");
                }
            }
        }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     strGaKaoKaHao = Basic.RequestHelper.GetQueryString("kh");
     Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByKaHao(strGaKaoKaHao);
     if (info == null || info.IsArt != 1)
     {
         Basic.MsgHelper.AlertBackMsg("不合法的访问");
     }
     else
     {
         Entity.YKStudentXinXi infoYK = DAL.YKStudentXinXi.YKStudentXinXiEntityGetByGaoKaoKaHao(strGaKaoKaHao);
         if (infoYK != null)
         {
             Basic.MsgHelper.AlertUrlMsg("不合法的访问", "/");
         }
     }
 }
コード例 #6
0
ファイル: ChengJiEdit.aspx.cs プロジェクト: srsman/gaokao2015
        void Bind()
        {
            hidKeLei.Value = userinfo.KeLei.ToString();

            Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByStudentId(userinfo.StudentId);
            if (info != null)
            {
                string strTiXing1 = "";
                Entity.StudentGaoKaoHistory infoChengJi = DAL.StudentGaoKaoHistory.StudentGaoKaoHistoryEntityGet(userinfo.StudentId);
                if (infoChengJi != null)
                {
                    strTiXing1 = "<div class=\"tx\">"
                                 + "提醒:" + Basic.Utils.StrToDateStr(infoChengJi.AddTime.ToString()) + "你设定分数如下"
                                 + " </div>"
                                 + " <div class=\"gkcjul\">"
                                 + " <ul>"
                                 + " <li>考生类别:" + DAL.Common.GetKeLeiMingCheng(userinfo.KeLei) + "</li>"
                                 + " <li>考生分数:" + infoChengJi.FenShu + "</li>";
                    if (userinfo.ProvinceId == 11)//浙江
                    {
                        strTiXing1 += " <li>一批次分数线预估:" + infoChengJi.PcFirst + "</li>"
                                      + " <li>二批次分数线预估:" + infoChengJi.PcSecond + "</li>"
                                      + " <li>三批次分数线预估:" + infoChengJi.PcThird + "</li>";
                    }
                    else
                    {
                        strTiXing1 += " <li>一本分数线预估:" + infoChengJi.PcFirst + "</li>"
                                      + " <li>二本分数线预估:" + infoChengJi.PcSecond + "</li>"
                                      + " <li>三本分数线预估:" + infoChengJi.PcThird + "</li>"
                                      + " <li>专科分数线预估:" + infoChengJi.PcZhuanKeFirst + "</li>";
                    }
                    strTiXing1 += " </ul></div>";
                }
                else
                {
                    strTiXing1 = "<div class=\"tx\">"
                                 + "提醒:你还没有设定分数"
                                 + " </div>";
                }

                ltlTiXing1.Text = strTiXing1;
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (userinfo.StudentLevel > 1 && userinfo.StudentLevel < 9)
            {
                Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByKaHao(userinfo.Bank);
                if (info != null)
                {
                    UserCenterLeft1.userinfo = userinfo;

                    ProvinceId = userinfo.ProvinceId;
                }
                else
                {
                    Basic.MsgHelper.AlertBackMsg("不合法的访问");
                }
            }
            else
            {
                Basic.MsgHelper.AlertBackMsg("不合法的访问");
            }
        }
コード例 #8
0
        /*点击提交*/
        protected void goSave_Click(object sender, EventArgs e)
        {
            string strOldPwd  = this.txtOldPwd.Text;  //旧密码
            string strNewPwd  = this.txtNewPwd.Text;  //新密码
            string strNewPwd2 = this.txtNewPwd2.Text; //确认新密码

            if (strNewPwd != strNewPwd2)
            {
                Basic.MsgHelper.AlertBackMsg("两次输入的新密码不一致");
            }

            Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByKaHao(userinfo.Bank);
            if (info != null)
            {
                if (info.MiMa == strOldPwd)
                {
                    bool b = DAL.GaoKaoCard.UpdateGaoKaoCardPwd(userinfo.Bank, strNewPwd);
                    if (userinfo.StudentId > 0)
                    {
                        DAL.GaoKaoCard.UpdateJoinStudentPwd(userinfo.StudentId, strNewPwd);
                    }
                    if (b == true)
                    {
                        Basic.MsgHelper.AlertUrlMsg("密码修改成功", "/TuiJian/default.aspx");
                    }
                    else
                    {
                        Basic.MsgHelper.AlertBackMsg("密码修改失败");
                    }
                }
                else
                {
                    Basic.MsgHelper.AlertBackMsg("旧密码输入错误");
                }
            }
            else
            {
                Basic.MsgHelper.AlertBackMsg("不合法的访问");
            }
        }
コード例 #9
0
        void Bind()
        {
            hidKeLei.Value = userinfo.KeLei.ToString();

            Entity.GaoKaoCard info = DAL.GaoKaoCard.GaoKaoCardEntityGetByStudentId(userinfo.StudentId);
            if (info != null)
            {
                string strTiXing1 = "";
                Entity.StudentGaoKaoHistory_ZheJiang infoChengJi = DAL.StudentGaoKaoHistory_ZheJiang.StudentGaoKaoHistory_ZheJiangEntityGetByStudentId(userinfo.StudentId);
                if (infoChengJi != null)
                {
                    strTiXing1 = "<div class=\"tx\">"
                                 + "提醒:" + Basic.Utils.StrToDateStr(infoChengJi.AddTime.ToString()) + "你设定分数如下"
                                 + " </div>"
                                 + " <div class=\"gkcjul\">"
                                 + " <ul>"
                                 + " <li>科类:" + DAL.Common.GetKeLeiMingCheng(userinfo.KeLei) + "</li>"
                                 + " <li>语文:" + infoChengJi.YuWen + "</li>"
                                 + " <li>数学:" + infoChengJi.ShuXue + "</li>"
                                 + " <li>外语:" + infoChengJi.YingYu + "</li>"
                                 + " <li>综合:" + infoChengJi.ZongHe + "</li>"
                                 + " <li>自选:" + infoChengJi.ZiXuan + "</li>"
                                 + " <li>技术:" + infoChengJi.JiShu + "</li>"
                                 + " <li>总分1:" + infoChengJi.ZongFen1 + "</li>"
                                 + " <li>总分2:" + infoChengJi.ZongFen2 + "</li>"
                                 + " <li>总分3:" + infoChengJi.ZongFen3 + "</li>";
                    strTiXing1 += " </ul></div>";
                }
                else
                {
                    strTiXing1 = "<div class=\"tx\">"
                                 + "提醒:你还没有设定成绩"
                                 + " </div>";
                }

                ltlTiXing1.Text = strTiXing1;
            }
        }
コード例 #10
0
        //填充学生报告的基本信息
        public static Microsoft.Office.Interop.Word.Table BaseInfo(Microsoft.Office.Interop.Word.Table tb1, Entity.GaoKaoCard infoGaoKaoCard, Entity.Join_Student infoStudent)
        {
            string strProvinceName = "";

            Entity.Province infoProvince = DAL.Province.ProvinceEntityGet(infoStudent.ProvinceId);
            if (infoProvince != null)
            {
                strProvinceName = infoProvince.ProvinceName;
            }

            if (tb1.Rows.Count == 4)
            {
                //在指定单元格填值
                //第1行
                tb1.Cell(1, 2).Range.Text = infoStudent.StudentName;
                tb1.Cell(1, 4).Range.Text = (infoStudent.Sex == 1 ? "女" : "男");
                //第2行
                tb1.Cell(2, 2).Range.Text = infoStudent.SchoolName;
                tb1.Cell(2, 4).Range.Text = (infoStudent.WenLi == 1 ? "文史" : "理工");
                //第3行
                tb1.Cell(3, 2).Range.Text = strProvinceName;
                tb1.Cell(3, 4).Range.Text = infoStudent.GKYear.ToString();
                //第4行
                tb1.Cell(4, 2).Range.Text = infoGaoKaoCard.KaHao;
                tb1.Cell(4, 4).Range.Text = Basic.TypeConverter.StrToDateStr(DateTime.Now.ToString());
            }
            return(tb1);
        }
コード例 #11
0
ファイル: Ability.cs プロジェクト: srsman/gaokao2015
        //生成word文档
        public static void ExpWordByWord(int intStudentId)
        {
            Entity.Join_Student infoStudent = DAL.Join_Student.Join_StudentEntityGet(intStudentId);
            if (infoStudent == null)
            {
                return;
            }

            Entity.GaoKaoCard infoGaoKaoCard = DAL.GaoKaoCard.GaoKaoCardEntityGetByStudentId(intStudentId);
            if (infoGaoKaoCard == null)
            {
                return;
            }
            //文件路径和名称
            object fileName = System.Web.HttpContext.Current.Server.MapPath("~/") + "CePing/ImgOfResult/Ability/" + infoGaoKaoCard.KaHao + "(" + infoStudent.StudentName + "_" + intStudentId + ")" + "_职业能力测评.doc";//获取服务器路径

            //判定文件是否已经存在了
            if (Basic.Utils.FileExists(fileName.ToString()))
            {
                return;
            }

            #region 基本信息处理
            DataTable dt = DAL.Join_AbilityResults.Join_AbilityResultsList("UserId=" + intStudentId); //获取该学生的测试结果
            if (dt != null && dt.Rows.Count > 0)
            {
                string Language    = dt.Rows[0]["Language"].ToString();
                string Tissue      = dt.Rows[0]["Tissue"].ToString();
                string Among       = dt.Rows[0]["Among"].ToString();
                string Mathematics = dt.Rows[0]["Mathematics"].ToString();
                string Motion      = dt.Rows[0]["Motion"].ToString();
                string Writing     = dt.Rows[0]["Writing"].ToString();
                string Watch       = dt.Rows[0]["Watch"].ToString();
                string Space       = dt.Rows[0]["Space"].ToString();
                string Art         = dt.Rows[0]["Art"].ToString();
                //各能力得分
                intYanYu           = Basic.TypeConverter.StrToInt(Language);
                intShuLi           = Basic.TypeConverter.StrToInt(Tissue);
                intKongJianPanDuan = Basic.TypeConverter.StrToInt(Among);
                intChaJueXiJie     = Basic.TypeConverter.StrToInt(Mathematics);
                intShuXie          = Basic.TypeConverter.StrToInt(Motion);
                intYunDongXieTiao  = Basic.TypeConverter.StrToInt(Writing);
                intDongShou        = Basic.TypeConverter.StrToInt(Watch);
                intSheHuiJiaoWang  = Basic.TypeConverter.StrToInt(Space);
                intZuZhiGuanLi     = Basic.TypeConverter.StrToInt(Art);
            }
            else
            {
                return;
            }

            //创建数组,通过冒泡排序得到最大值和最小值
            list = new int[] { intYanYu, intShuLi, intKongJianPanDuan, intChaJueXiJie, intShuXie, intYunDongXieTiao, intDongShou, intSheHuiJiaoWang, intZuZhiGuanLi };
            DAL.Comm.BubbleSortUp(list);
            intMax = list[8]; //最大值
            intMin = list[0]; //最小值

            #endregion


            Word._Application app = new Word.Application();
            //表示System.Type信息中的缺少值
            object nothing = Type.Missing;
            try
            {
                //读取模板文件
                object temp = System.Web.HttpContext.Current.Server.MapPath("~/CePing/TempletOfAbility.doc");//读取模板文件
                //建立一个基于摸版的文档
                Word._Document doc = app.Documents.Add(ref temp, ref nothing, ref nothing, ref nothing);
                //
                #region 填充学生基本信息

                Word.Table tb1 = doc.Tables[1];
                if (tb1.Rows.Count == 4)
                {
                    GenerateWordDocument.BaseInfo(tb1, infoGaoKaoCard, infoStudent);
                }

                #endregion

                //
                #region 职业兴趣测评结果:各能力得分、评级
                Word.Table tb2 = doc.Tables[2];
                if (tb2.Rows.Count == 10)
                {
                    //在指定单元格填值
                    //第2行 言语能力
                    tb2.Cell(2, 2).Range.Text = intYanYu.ToString();
                    tb2.Cell(2, 3).Range.Text = GenerateWordDocument.AbilityLevel(intYanYu);
                    //第3行 数理能力
                    tb2.Cell(3, 2).Range.Text = intShuLi.ToString();
                    tb2.Cell(3, 3).Range.Text = GenerateWordDocument.AbilityLevel(intShuLi);
                    //第4行 空间判断能力
                    tb2.Cell(4, 2).Range.Text = intKongJianPanDuan.ToString();
                    tb2.Cell(4, 3).Range.Text = GenerateWordDocument.AbilityLevel(intKongJianPanDuan);
                    //第5行 察觉细节能力
                    tb2.Cell(5, 2).Range.Text = intChaJueXiJie.ToString();
                    tb2.Cell(5, 3).Range.Text = GenerateWordDocument.AbilityLevel(intChaJueXiJie);
                    //第6行 书写能力
                    tb2.Cell(6, 2).Range.Text = intShuXie.ToString();
                    tb2.Cell(6, 3).Range.Text = GenerateWordDocument.AbilityLevel(intShuXie);
                    //第7行 运动协调能力
                    tb2.Cell(7, 2).Range.Text = intYunDongXieTiao.ToString();
                    tb2.Cell(7, 3).Range.Text = GenerateWordDocument.AbilityLevel(intYunDongXieTiao);
                    //第8行 动手能力
                    tb2.Cell(8, 2).Range.Text = intDongShou.ToString();
                    tb2.Cell(8, 3).Range.Text = GenerateWordDocument.AbilityLevel(intDongShou);
                    //第9行 社会交往能力
                    tb2.Cell(9, 2).Range.Text = intSheHuiJiaoWang.ToString();
                    tb2.Cell(9, 3).Range.Text = GenerateWordDocument.AbilityLevel(intSheHuiJiaoWang);
                    //第10行 组织管理能力
                    tb2.Cell(10, 2).Range.Text = intZuZhiGuanLi.ToString();
                    tb2.Cell(10, 3).Range.Text = GenerateWordDocument.AbilityLevel(intZuZhiGuanLi);
                }
                #endregion


                //
                #region 模板中 占位符的替换

                Microsoft.Office.Interop.Word.Document oDoc = (Microsoft.Office.Interop.Word.Document)doc;
                JieGuoJieXi();

                //学生姓名
                GenerateWordDocument.ReplaceZF(oDoc, "@studentname", infoStudent.StudentName, Type.Missing);

                //你可能喜欢的专业
                for (int i = 0; i < arrTuiJianZhuanYe.Length; i++)
                {
                    GenerateWordDocument.ReplaceZF(oDoc, "@xihuanzhuanye" + i, arrTuiJianZhuanYe[i], Type.Missing);
                }
                if (arrTuiJianZhuanYe.Length < 9)
                {
                    for (int i = arrTuiJianZhuanYe.Length; i < 9; i++)
                    {
                        GenerateWordDocument.ReplaceZF(oDoc, "@xihuanzhuanye" + i, "", Type.Missing);
                    }
                }

                //不建议选择的专业范围
                for (int i = 0; i < arrBuTuiJianZhuanYe.Length; i++)
                {
                    GenerateWordDocument.ReplaceZF(oDoc, "@buxihuanzhuanye" + i, arrBuTuiJianZhuanYe[i], Type.Missing);
                }
                if (arrBuTuiJianZhuanYe.Length < 9)
                {
                    for (int i = arrBuTuiJianZhuanYe.Length; i < 9; i++)
                    {
                        GenerateWordDocument.ReplaceZF(oDoc, "@buxihuanzhuanye" + i, "", Type.Missing);
                    }
                }

                #endregion

                //
                #region 保存到服务器

                //保存doc文档
                oDoc.SaveAs(ref fileName, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing,
                            ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing,
                            ref nothing, ref nothing, ref nothing);
                oDoc.Close(ref nothing, ref nothing, ref nothing);
                app.Quit(ref nothing, ref nothing, ref nothing);

                //输出word 到客户端
                //   GenerateWordDocument.ExtWord(fileName.ToString(), "ts.doc");

                #endregion
            }
            catch (Exception ex)
            {
                //  resultMsg = "导出错误:" + ex.Message;
                app.Quit(ref nothing, ref nothing, ref nothing);
            }
        }
コード例 #12
0
        /*艺考*/
        public static void FenPeiCard(Entity.DingDan info, int intIsArt)
        {
            //验证成功,验证是否缴费,如果是已经缴费,
            if (info != null)
            {
                //将卡号和密码发送短信给用户

                //发送内容为什么呢?,卡号和密码怎么来的呢?

                int count = 0;

                string strMobileContent = "用户您好:您于" + string.Format("{0:yyyy-MM-dd HH:mm}", DateTime.Now) + " 购买的格伦高考报考卡";
                if (info.Count > 0)
                {
                    for (int i = 0; i < info.Count; i++)
                    {
                        Entity.GaoKaoCard infoCard = new Entity.GaoKaoCard();
                        infoCard.KaHao            = GetKaHao();                               //卡号
                        infoCard.MiMa             = "GKBK" + new Random().Next(10000, 99999); //密码
                        infoCard.StudentId        = 0;
                        infoCard.ProvinceId       = 0;
                        infoCard.Belong           = 2; //卡的属性:1总部 2网上购买 3加盟店 4代理商
                        infoCard.DianId           = 4;
                        infoCard.CardLevel        = 4; //卡的级别:2 高考查询卡,3 高考测试卡,4 格伦高考卡,5 VIP测试卡,6 报考VIP卡
                        infoCard.IsPause          = 0;
                        infoCard.AllowChangeCount = 30;
                        infoCard.HaveChangeCount  = 0;
                        infoCard.EndTime          = DateTime.Parse("2015-09-01");
                        //  infoCard.RegisterDate = DateTime.Now;
                        infoCard.Memo       = "网上购买";
                        infoCard.DingDanHao = info.DingDanHao;

                        int GaoKaoCardId = DAL.GaoKaoCard.GaoKaoCardAdd(infoCard);
                        if (GaoKaoCardId > 0)
                        {
                            DAL.GaoKaoCard.GaoKaoCardIsArt(GaoKaoCardId);
                            strMobileContent += "卡号:" + infoCard.KaHao + ",密码:" + infoCard.MiMa + ";";

                            count++;
                        }
                    }
                }
                if (count == info.Count)
                {
                    //发送短信
                    if (strMobileContent.EndsWith(";"))
                    {
                        strMobileContent = strMobileContent.Substring(0, strMobileContent.Length - 1);
                    }

                    strMobileContent += "请保存好您的账号密码。";

                    Basic.SendMobile.SendMobileMsg(info.CellMobile, strMobileContent);
                    //  Basic.Email.sendMail("*****@*****.**", "购买报考卡(第二版本1)", strMobileContent);
                }
                else
                {
                    string strContent = "订单表中,订单号为" + info.DingDanHao + "的考生,在付款之后,往gaokaocard表中插入数据时失败,请处理。";
                    //18610241135
                    Basic.SendMobile.SendMobileMsg("18500525896", strContent);
                    //  Basic.Email.sendMail("*****@*****.**", "购买报考卡(第二版本2)", strContent);
                }
            }
        }
コード例 #13
0
ファイル: Ttarget.aspx.cs プロジェクト: srsman/gaokao2015
        //生成word文档
        void ExpWordByWord()
        {
            Word._Application app = new Word.Application();
            //表示System.Type信息中的缺少值
            object nothing = Type.Missing;

            try
            {
                //高考卡号
                string            strKaHao       = "";
                Entity.GaoKaoCard infoGaoKaoCard = DAL.GaoKaoCard.GaoKaoCardEntityGetByStudentId(userinfo.StudentId);
                if (infoGaoKaoCard != null)
                {
                    strKaHao = infoGaoKaoCard.KaHao;
                }
                //省份名称
                string strProvinceName = userinfo.ProvinceName;

                //读取模板文件
                object temp = System.Web.HttpContext.Current.Server.MapPath("~/CePing/职业兴趣模板.doc");//读取模板文件

                //建立一个基于摸版的文档
                Word._Document doc = app.Documents.Add(ref temp, ref nothing, ref nothing, ref nothing);
                //学生基本信息
                Word.Table tb1 = doc.Tables[1];
                if (tb1.Rows.Count == 4)
                {
                    //在指定单元格填值
                    //第1行
                    tb1.Cell(1, 2).Range.Text = userinfo.StudentName;
                    tb1.Cell(1, 4).Range.Text = (user.Sex == 1 ? "女" : "男");
                    //第2行
                    tb1.Cell(2, 2).Range.Text = user.SchoolName;
                    tb1.Cell(2, 4).Range.Text = (userinfo.KeLei == 1 ? "文史" : "理工");
                    //第3行
                    tb1.Cell(3, 2).Range.Text = strProvinceName;
                    tb1.Cell(3, 4).Range.Text = user.GKYear.ToString();
                    //第4行
                    tb1.Cell(4, 2).Range.Text = strKaHao;
                    tb1.Cell(4, 4).Range.Text = Basic.TypeConverter.StrToDateStr(DateTime.Now.ToString());
                }

                //插入图片
                Word.Table tb2              = doc.Tables[2];
                string     path             = AppDomain.CurrentDomain.BaseDirectory + ("CePing/ImgOfResult/Holland/") + user.StudentId + "_holland.jpg";
                string     FileName         = path;//@"C:\chart.jpeg";//图片所在路径
                object     LinkToFile       = false;
                object     SaveWithDocument = true;
                object     Anchor           = tb2.Range;
                doc.Application.ActiveDocument.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor);
                //doc.Application.ActiveDocument.InlineShapes[1].Width = 300f;//图片宽度
                //doc.Application.ActiveDocument.InlineShapes[1].Height = 200f;//图片高度

                //object readOnly = false;
                //object isVisible = false;

                //职业兴趣测评分类说明
                Word.Table tb3 = doc.Tables[3];
                if (tb3.Rows.Count == 7)
                {
                    //在指定单元格填值
                    //第2行 现实
                    tb3.Cell(2, 2).Range.Text = intReality.ToString();
                    tb3.Cell(2, 3).Range.Text = Level(intReality);
                    //第3行 研究
                    tb3.Cell(3, 2).Range.Text = intStudy.ToString();
                    tb3.Cell(3, 3).Range.Text = Level(intStudy);
                    //第4行 艺术
                    tb3.Cell(4, 2).Range.Text = intArt.ToString();
                    tb3.Cell(4, 3).Range.Text = Level(intArt);
                    //第5行 社会
                    tb3.Cell(5, 2).Range.Text = intSociety.ToString();
                    tb3.Cell(5, 3).Range.Text = Level(intSociety);
                    //第6行 企业
                    tb3.Cell(6, 2).Range.Text = intBusiness.ToString();
                    tb3.Cell(6, 3).Range.Text = Level(intBusiness);
                    //第7行 常规
                    tb3.Cell(7, 2).Range.Text = intTradition.ToString();
                    tb3.Cell(7, 3).Range.Text = Level(intTradition);
                }


                //模板中 占位符的替换
                Microsoft.Office.Interop.Word.Document oDoc = (Microsoft.Office.Interop.Word.Document)doc;
                bb();
                //根据你最强的兴趣,可见你的特点是
                ReplaceZF(oDoc, "@xqlx", strTeDian, Type.Missing);
                //你可能喜欢的专业
                for (int i = 0; i < arrTuiJianZhuanYe.Length; i++)
                {
                    ReplaceZF(oDoc, "@xihuanzhuanye" + i, arrTuiJianZhuanYe[i], Type.Missing);
                }
                if (arrTuiJianZhuanYe.Length < 6)
                {
                    for (int i = arrTuiJianZhuanYe.Length; i < 6; i++)
                    {
                        ReplaceZF(oDoc, "@xihuanzhuanye" + i, "", Type.Missing);
                    }
                }

                //不建议选择的专业范围
                for (int i = 0; i < arrBuTuiJianZhuanYe.Length; i++)
                {
                    ReplaceZF(oDoc, "@buxihuanzhuanye" + i, arrBuTuiJianZhuanYe[i], Type.Missing);
                }
                if (arrBuTuiJianZhuanYe.Length < 6)
                {
                    for (int i = arrBuTuiJianZhuanYe.Length; i < 6; i++)
                    {
                        ReplaceZF(oDoc, "@buxihuanzhuanye" + i, "", Type.Missing);
                    }
                }


                //保存到服务器
                object fileName = System.Web.HttpContext.Current.Server.MapPath("~/") + "CePing/ImgOfResult/Holland/" + strKaHao + "(" + userinfo.StudentName + "_" + userinfo.StudentId + ")" + "_职业兴趣测评.doc";//获取服务器路径
                //保存doc文档
                oDoc.SaveAs(ref fileName, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing,
                            ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing,
                            ref nothing, ref nothing, ref nothing);
                oDoc.Close(ref nothing, ref nothing, ref nothing);
                app.Quit(ref nothing, ref nothing, ref nothing);

                //输出word
                ExtWord(fileName.ToString(), "ts.doc");
            }
            catch (Exception ex)
            {
                //  resultMsg = "导出错误:" + ex.Message;
                app.Quit(ref nothing, ref nothing, ref nothing);
            }
        }