Exemplo n.º 1
0
        public static bool Join_StudentEdit_WanShanXinXi(Entity.Join_Student info)
        {
            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@StudentId",       SqlDbType.Int,        4, info.StudentId),
                SqlDB.MakeInParam("@StudentName",     SqlDbType.NVarChar,  50, info.StudentName),
                SqlDB.MakeInParam("@Sex",             SqlDbType.Int,        4, info.Sex),
                SqlDB.MakeInParam("@CellPhone",       SqlDbType.VarChar,   50, info.CellPhone),
                SqlDB.MakeInParam("@SchoolName",      SqlDbType.NVarChar, 150, info.SchoolName),
                SqlDB.MakeInParam("@FuQinPhone",      SqlDbType.NVarChar,  50, info.FuQinPhone),
                SqlDB.MakeInParam("@MuQinPhone",      SqlDbType.NVarChar,  50, info.MuQinPhone),
                SqlDB.MakeInParam("@WenLi",           SqlDbType.Int,        4, info.WenLi),
                SqlDB.MakeInParam("@BanJi",           SqlDbType.NVarChar, 100, info.BanJi),
                SqlDB.MakeInParam("@BanZhuRen",       SqlDbType.NVarChar, 100, info.BanZhuRen),
                SqlDB.MakeInParam("@ProvinceId",      SqlDbType.Int,        4, info.ProvinceId),
                SqlDB.MakeInParam("@CityId",          SqlDbType.Int,        4, info.CityId),
                SqlDB.MakeInParam("@CountyId",        SqlDbType.Int,        4, info.CountyId),
                SqlDB.MakeInParam("@BanZhuRenMobile", SqlDbType.NVarChar, 100, info.BanZhuRenMobile),
                SqlDB.MakeInParam("@GKYear",          SqlDbType.Int,        4, info.GKYear),
                SqlDB.MakeInParam("@StudentLevel",    SqlDbType.Int,        4, info.StudentLevel),
            };
            int intReturnValue = 0;

            intReturnValue = SqlDB.ExecuteNonQuery(strCon, CommandType.StoredProcedure, "Join_StudentEdit_WanShanXinXi", prams);
            if (intReturnValue == 1)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        void Bind()
        {
            Entity.Join_Student info = DAL.Join_Student.Join_StudentEntityGet(userinfo.StudentId);
            if (info != null)
            {
                txtBanJi.Text           = info.BanJi;
                txtBanZhuRen.Text       = info.BanZhuRen;
                txtBanZhuRenMobile.Text = info.BanZhuRenMobile;
                txtFMobile.Text         = info.FuQinPhone;
                txtMMobile.Text         = info.MuQinPhone;
                txtMobile.Text          = info.CellPhone;
                txtSchoolName.Text      = info.SchoolName;
                txtTrueName.Text        = info.StudentName;

                DataTable dt = DAL.S_City.S_CityGet(userinfo.ProvinceId);
                sel2.DataSource     = dt;
                sel2.DataTextField  = "CityName";
                sel2.DataValueField = "CityID";
                sel2.DataBind();
                sel2.Items.Insert(0, new ListItem("--城市--", "0"));

                ddlGKYear.SelectedValue   = info.GKYear.ToString();
                ddlSex.SelectedValue      = info.Sex.ToString();
                ddlProvince.SelectedValue = userinfo.ProvinceId.ToString();
                sel2.SelectedValue        = info.CityId.ToString();


                hidCityId.Value   = info.CityId.ToString();
                hidCountyId.Value = info.CountyId.ToString();
                hidKeLei.Value    = info.WenLi.ToString();
            }
        }
Exemplo n.º 3
0
 void page_Loading(object sender, EventArgs e)
 {
     if (userinfo.StudentId > 0)
     {
         user = DAL.Join_Student.Join_StudentEntityGet(userinfo.StudentId);
     }
     else
     {
         Basic.MsgHelper.AlertUrlMsg("请先登录", "/login.html");
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 学生信息
        /// </summary>
        void Student()
        {
            Entity.Join_Student model = DAL.Join_Student.Join_StudentEntityGet(this.user.StudentId);
            if (model != null)
            {
                if (model.StudentName != "")
                {
                    ltr_StudentName.Text = model.StudentName;

                    return;
                }
                else
                {
                    ltr_StudentName.Text = model.StudentBank;
                }
            }
            else
            {
                ltr_StudentName.Text = this.user.StudentId.ToString();
            }
        }
Exemplo n.º 5
0
 public static int Join_StudentAdd_WanShanXinXi(Entity.Join_Student info)
 {
     SqlParameter[] prams =
     {
         SqlDB.MakeInParam("@StudentName",     SqlDbType.NVarChar,  50, info.StudentName),
         SqlDB.MakeInParam("@Sex",             SqlDbType.Int,        4, info.Sex),
         SqlDB.MakeInParam("@CellPhone",       SqlDbType.VarChar,   50, info.CellPhone),
         SqlDB.MakeInParam("@SchoolName",      SqlDbType.NVarChar, 150, info.SchoolName),
         SqlDB.MakeInParam("@FuQinPhone",      SqlDbType.NVarChar,  50, info.FuQinPhone),
         SqlDB.MakeInParam("@MuQinPhone",      SqlDbType.NVarChar,  50, info.MuQinPhone),
         SqlDB.MakeInParam("@WenLi",           SqlDbType.Int,        4, info.WenLi),
         SqlDB.MakeInParam("@BanJi",           SqlDbType.NVarChar, 100, info.BanJi),
         SqlDB.MakeInParam("@BanZhuRen",       SqlDbType.NVarChar, 100, info.BanZhuRen),
         SqlDB.MakeInParam("@ProvinceId",      SqlDbType.Int,        4, info.ProvinceId),
         SqlDB.MakeInParam("@CityId",          SqlDbType.Int,        4, info.CityId),
         SqlDB.MakeInParam("@CountyId",        SqlDbType.Int,        4, info.CountyId),
         SqlDB.MakeInParam("@BanZhuRenMobile", SqlDbType.NVarChar, 100, info.BanZhuRenMobile),
         SqlDB.MakeInParam("@GKYear",          SqlDbType.Int,        4, info.GKYear),
         SqlDB.MakeInParam("@StudentLevel",    SqlDbType.Int,        4, info.StudentLevel),
     };
     return(Basic.Utils.StrToInt(SqlDB.ExecuteScalar(strCon, CommandType.StoredProcedure, "Join_StudentAdd_WanShanXinXi", prams).ToString(), -1));
 }
Exemplo n.º 6
0
        protected void btnGoTo_Click(object sender, EventArgs e)
        {
            Entity.YKStudentXinXi YKInfo = new Entity.YKStudentXinXi();
            YKInfo.GaoKaoKaHao = strGaKaoKaHao;

            #region 表单验证
            string strName = Basic.RequestHelper.GetFormString(tbName.ClientID);
            if (string.IsNullOrEmpty(strName))
            {
                Basic.MsgHelper.AlertBackMsg("请填写姓名");
            }
            YKInfo.StudentName = strName;
            int intNanOrNv = Basic.Utils.StrToInt(ddlSex.SelectedValue, -1);
            if (intNanOrNv < 0)
            {
                Basic.MsgHelper.AlertBackMsg("请选择性别");
            }
            YKInfo.Sex = intNanOrNv;
            string strChuSheng = Basic.RequestHelper.GetFormString(tbChuSheng.ClientID);
            if (string.IsNullOrEmpty(strChuSheng))
            {
                Basic.MsgHelper.AlertBackMsg("请输入出生年月");
            }
            YKInfo.ChuShengRiQi = strChuSheng;
            string strBiYeSchool = Basic.RequestHelper.GetFormString(tbBiYeXueXiao.ClientID);
            YKInfo.BiYeXueXiao = strBiYeSchool;

            string strQq = Basic.RequestHelper.GetFormString(tbQq.ClientID);
            YKInfo.Sqq = strQq;

            int intJFFW = Basic.RequestHelper.GetFormInt(ddlJFRKFW.ClientID, -1);
            YKInfo.JiaFenFW = intJFFW;

            string strFZ = Basic.RequestHelper.GetFormString(tbFenZhi.ClientID);
            YKInfo.FenZhi = strFZ;

            string strZJZYSXQK = Basic.RequestHelper.GetFormString(tbTiJian.ClientID);
            YKInfo.TJZYSXQK = strZJZYSXQK;

            int inyYiKaoTypeId = Basic.RequestHelper.GetFormInt(ddlYKType.ClientID, 0);
            YKInfo.YiKaoChengShiId = inyYiKaoTypeId;

            string strYKCS = ddlYKType.SelectedItem.Text;
            YKInfo.YiKaoChengShi = strYKCS;


            int    TpId   = Basic.TypeConverter.StrToInt(HidYKZYTypeId.Value);
            string TpName = HidYKZYType.Value;
            if (TpId < 1)
            {
                Basic.MsgHelper.AlertBackMsg("请选择艺考专业");
            }
            YKInfo.YiKaoTypeId = TpId;
            YKInfo.YiKaoType   = TpName;
            //int intYKType = Basic.RequestHelper.GetFormInt(ddlZhuaYeType.ClientID, 0);
            //YKInfo.YiKaoTypeId = intYKType;

            //string strYKT = ddlZhuaYeType.SelectedItem.Text;
            //YKInfo.YiKaoType = strYKT;

            string strYXDQ = Basic.RequestHelper.GetFormString(tbYXDQ.ClientID);
            YKInfo.YiXiangDiQu = strYXDQ;

            int strYXType = Basic.RequestHelper.GetFormInt(ddlYuanXiaoType.ClientID, 0);
            YKInfo.YuanXiaoType = strYXType;

            string strLianKao = Basic.RequestHelper.GetFormString(tbLianKaoChengJi.ClientID);
            YKInfo.LianKaoChengJi = strLianKao;

            int    pId   = Basic.TypeConverter.StrToInt(hidProvince.Value);
            string pName = hidProvinceName.Value;
            int    cId   = Basic.TypeConverter.StrToInt(hidCity.Value);
            string cName = hidCityName.Value;
            int    xId   = Basic.TypeConverter.StrToInt(hidCounty.Value);
            string xName = hidCountyName.Value;

            if (pId < 1)
            {
                Basic.MsgHelper.AlertBackMsg("请选择省份");
            }
            if (cId < 1)
            {
                Basic.MsgHelper.AlertBackMsg("请选择市");
            }
            if (xId < 1)
            {
                Basic.MsgHelper.AlertBackMsg("请选择区/县");
            }
            YKInfo.SshengId = pId;
            YKInfo.Ssheng   = pName;
            YKInfo.SshiId   = cId;
            YKInfo.Sshi     = cName;
            YKInfo.SQuId    = xId;
            YKInfo.SQu      = xName;
            string strSPhone = Basic.RequestHelper.GetFormString(tbKaoShengPhone.ClientID);
            if (!System.Text.RegularExpressions.Regex.IsMatch(strSPhone, @"^(1[3|5|8|][0-9]|15[0|3|6|7|8|9]|18[8|9])\d{8}$") || string.IsNullOrEmpty(strSPhone))
            {
                Basic.MsgHelper.AlertBackMsg("您没有输入手机号,或者手机号输入格式有误");
            }
            YKInfo.KaoShengPhone = strSPhone;

            string strJiaZhangPhone = Basic.RequestHelper.GetFormString(tbJiaZhangPhone.ClientID);
            YKInfo.JiaZhangPhone = strJiaZhangPhone;
            string regex    = "^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$";
            string strEmail = Basic.RequestHelper.GetFormString(tbEmail.ClientID);
            if (!Regex.IsMatch(strEmail, regex) || string.IsNullOrEmpty(strEmail))
            {
                Basic.MsgHelper.AlertBackMsg("您没有输入邮箱,或者邮箱输入格式有误");
            }
            YKInfo.Email = strEmail;

            int BaoKaoLeiBie = Basic.RequestHelper.GetFormInt(ddlBaoKaoType.ClientID, 0);
            YKInfo.BaoKaoType = BaoKaoLeiBie;


            int IsJianBao = Basic.RequestHelper.GetFormInt(ddlIsJianBao.ClientID, 0);
            YKInfo.IsJBWL = IsJianBao;

            int intKaoShengType = Basic.RequestHelper.GetFormInt(ddlKaoShengType.ClientID, 0);
            YKInfo.KaoShengType = intKaoShengType;

            string strYXZY = Basic.RequestHelper.GetFormString(tbYXZhuanYe.ClientID);
            YKInfo.YiXiangZhuanYe = strYXZY;

            string strYXYX = Basic.RequestHelper.GetFormString(tbYXYuanXiao.ClientID);
            YKInfo.YiXiangYuanXiao = strYXZY;

            int intBanXueType = Basic.RequestHelper.GetFormInt(ddlBanXueType.ClientID, 0);
            YKInfo.BanXueType = intBanXueType;

            string strXiaoKaoQK = Basic.RequestHelper.GetFormString("txtXiaoKao");
            YKInfo.XiaoKaoQingKuang = strXiaoKaoQK;

            string strTSSM = Basic.RequestHelper.GetFormString("txtMeto");

            YKInfo.Meto = strTSSM;

            string strYGYW = Basic.RequestHelper.GetFormString(tbYGYuWen.ClientID);
            YKInfo.YGYuWen = strYGYW;
            string strYGSX = Basic.RequestHelper.GetFormString(tbYGShuXue.ClientID);
            YKInfo.YGShuXue = strYGSX;
            string strYGYY = Basic.RequestHelper.GetFormString(tbYGYingYu.ClientID);
            YKInfo.YGYingYu = strYGYY;
            string strYGZH = Basic.RequestHelper.GetFormString(tbYGZongHe.ClientID);
            YKInfo.YGZongHe = strYGZH;
            string strYGZF = Basic.RequestHelper.GetFormString(tbYGZongFen.ClientID);
            YKInfo.YGZongFen = strYGZF;

            string strGKYW = Basic.RequestHelper.GetFormString(tbGKYuWen.ClientID);
            YKInfo.GKYuWen = strGKYW;
            string strGKSX = Basic.RequestHelper.GetFormString(tbGKShuXue.ClientID);
            YKInfo.GKShuXue = strGKSX;
            string strGKYY = Basic.RequestHelper.GetFormString(tbGKuYingYu.ClientID);
            YKInfo.GKYingYu = strGKYY;
            string strGKZH = Basic.RequestHelper.GetFormString(tbGKZongHe.ClientID);
            YKInfo.GKZhongHe = strGKZH;
            string strGKZF = Basic.RequestHelper.GetFormString(tbGKZongFen.ClientID);
            YKInfo.GKZongFen = strGKZF;

            int CountId = DAL.YKStudentXinXi.YKStudentXinXiAdd(YKInfo);

            if (CountId > 0)
            {
                Entity.Join_Student info = new Entity.Join_Student();
                info.BanJi           = "";
                info.BanZhuRen       = "";
                info.BanZhuRenMobile = "";
                info.CellPhone       = YKInfo.KaoShengPhone;
                info.CityId          = YKInfo.SshiId;
                info.CountyId        = YKInfo.SQuId;
                info.FuQinPhone      = YKInfo.JiaZhangPhone;
                info.GKYear          = 2015;
                info.MuQinPhone      = YKInfo.JiaZhangPhone;
                info.ProvinceId      = YKInfo.SshengId;
                info.SchoolName      = YKInfo.BiYeXueXiao;
                info.Sex             = YKInfo.Sex;
                info.StudentName     = YKInfo.StudentName;
                info.WenLi           = (YKInfo.BaoKaoType == 1 ? 5 : 1);

                info.StudentLevel = 3;//会员卡是2 高考卡3

                int intId = DAL.TengXB.Join_Student.Join_StudentAdd_WanShanXinXi(info);
                if (intId > 0)
                {
                    if (DAL.GaoKaoCard.SetGaoKaoCardStudentId(intId, YKInfo.GaoKaoKaHao, YKInfo.SshengId))
                    {
                        Basic.MsgHelper.AlertUrlMsg("添加成功", "/");
                    }
                    else
                    {
                        Basic.MsgHelper.AlertBackMsg("添加失败...");
                    }
                }
                else
                {
                    Basic.MsgHelper.AlertBackMsg("添加失败..");
                }
            }
            else
            {
                Basic.MsgHelper.AlertBackMsg("添加失败");
            }

            #endregion
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        public static Entity.Join_Student Join_StudentEntityGetBank(string StudentBank, string StudentPass)
        {
            Entity.Join_Student info = new Entity.Join_Student();

            SqlParameter[] prams =
            {
                SqlDB.MakeInParam("@Bank",    SqlDbType.NVarChar, 100, StudentBank),
                SqlDB.MakeInParam("@Pass",    SqlDbType.NVarChar,  50, StudentPass),
                SqlDB.MakeInParam("@MD5Pass", SqlDbType.NVarChar,  50, Basic.CreateMD5.Md5Encrypt(StudentPass)),
            };
            DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.StoredProcedure, "StudentEntityGet", prams).Tables[0];

            // DataTable dt = SqlDB.ExecuteDataset(strCon, CommandType.Text, "SELECT * FROM [Join_Student] WHERE StudentBank = '" + StudentBank + "' AND (StudentPass = '******' OR StudentPass = '******')").Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {
                info.StudentId       = Basic.Utils.StrToInt(dt.Rows[0]["StudentId"].ToString(), 0);
                info.StudentBank     = dt.Rows[0]["StudentBank"].ToString();
                info.StudentPass     = dt.Rows[0]["StudentPass"].ToString();
                info.StudenName      = dt.Rows[0]["StudenName"].ToString();
                info.StudentName     = dt.Rows[0]["StudentName"].ToString();
                info.Sex             = Basic.Utils.StrToInt(dt.Rows[0]["Sex"].ToString(), 0);
                info.CellTel         = dt.Rows[0]["CellTel"].ToString();
                info.CellPhone       = dt.Rows[0]["CellPhone"].ToString();
                info.CellPhoneCheck  = Basic.Utils.StrToInt(dt.Rows[0]["CellPhoneCheck"].ToString(), 0);
                info.Address         = dt.Rows[0]["Address"].ToString();
                info.SchoolName      = dt.Rows[0]["SchoolName"].ToString();
                info.IdNumber        = dt.Rows[0]["IdNumber"].ToString();
                info.CheckIdNumber   = Basic.Utils.StrToInt(dt.Rows[0]["CheckIdNumber"].ToString(), 0);
                info.IdNumberPic     = dt.Rows[0]["IdNumberPic"].ToString();
                info.BirthDate       = dt.Rows[0]["BirthDate"].ToString();
                info.RegisterWay     = Basic.Utils.StrToInt(dt.Rows[0]["RegisterWay"].ToString(), 0);
                info.RegisterOrigin  = dt.Rows[0]["RegisterOrigin"].ToString();
                info.DldId           = Basic.Utils.StrToInt(dt.Rows[0]["DldId"].ToString(), 0);
                info.UserCategory    = Basic.Utils.StrToInt(dt.Rows[0]["UserCategory"].ToString(), 0);
                info.PositionCase    = dt.Rows[0]["PositionCase"].ToString();
                info.IsPause         = Basic.Utils.StrToInt(dt.Rows[0]["IsPause"].ToString(), 0);
                info.Mail            = dt.Rows[0]["Mail"].ToString();
                info.QQ              = dt.Rows[0]["QQ"].ToString();
                info.About           = dt.Rows[0]["About"].ToString();
                info.Company         = dt.Rows[0]["Company"].ToString();
                info.MSN             = dt.Rows[0]["MSN"].ToString();
                info.ArtDialog       = Basic.Utils.StrToInt(dt.Rows[0]["ArtDialog"].ToString(), 0);
                info.FuQinPhone      = dt.Rows[0]["FuQinPhone"].ToString();
                info.MuQinPhone      = dt.Rows[0]["MuQinPhone"].ToString();
                info.WenLi           = Basic.Utils.StrToInt(dt.Rows[0]["WenLi"].ToString(), 0);
                info.BanJi           = dt.Rows[0]["BanJi"].ToString();
                info.BanZhuRen       = dt.Rows[0]["BanZhuRen"].ToString();
                info.ProvinceId      = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0);
                info.CityId          = Basic.Utils.StrToInt(dt.Rows[0]["CityId"].ToString(), 0);
                info.CountyId        = Basic.Utils.StrToInt(dt.Rows[0]["CountyId"].ToString(), 0);
                info.IsAutoCreat     = Basic.Utils.StrToInt(dt.Rows[0]["IsAutoCreat"].ToString(), 0);
                info.BanZhuRenMobile = dt.Rows[0]["BanZhuRenMobile"].ToString();
                info.StudentLevel    = Basic.Utils.StrToInt(dt.Rows[0]["StudentLevel"].ToString(), 0);
                info.GKYear          = Basic.Utils.StrToInt(dt.Rows[0]["GKYear"].ToString(), 0);

                info.RegisterTime = Basic.Utils.StrToDateTime(dt.Rows[0]["RegisterTime"].ToString());

                return(info);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 9
0
        //生成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);
            }
        }
Exemplo n.º 10
0
        /*点击提交*/
        protected void goSave_Click(object sender, EventArgs e)
        {
            int intCityId   = Basic.TypeConverter.StrToInt(hidCityId.Value, 0);   //城市
            int intCountyId = Basic.TypeConverter.StrToInt(hidCountyId.Value, 0); //区/县
            int intKeLei    = Basic.TypeConverter.StrToInt(hidKeLei.Value, 0);    //科类

            if (intKeLei == 0)
            {
                Basic.MsgHelper.AlertBackMsg("请选择高考分科");
            }

            int intGKYear = Basic.TypeConverter.StrToInt(ddlGKYear.SelectedValue, 0);//高考年份

            if (intGKYear == 0)
            {
                Basic.MsgHelper.AlertBackMsg("请选择高考年份");
            }

            string strTrueName = this.txtTrueName.Text;//真实姓名

            if (strTrueName == "")
            {
                Basic.MsgHelper.AlertBackMsg("请填写学生姓名");
            }
            int    intSex             = Basic.TypeConverter.StrToInt(ddlSex.SelectedValue, 0); //性别
            string strMobile          = this.txtMobile.Text;                                   //学生手机
            string strFMobile         = this.txtFMobile.Text;                                  //父亲手机
            string strMMobile         = this.txtMMobile.Text;                                  //母亲手机
            string strSchoolName      = this.txtSchoolName.Text;                               //就读学校
            string strBanJi           = this.txtBanJi.Text;                                    //就读班级
            string strBanZhuRen       = this.txtBanZhuRen.Text;                                //班主任姓名
            string strBanZhuRenMobile = this.txtBanZhuRenMobile.Text;                          //班主任手机

            Entity.Join_Student info = DAL.Join_Student.Join_StudentEntityGet(userinfo.StudentId);
            info.BanJi           = strBanJi;
            info.BanZhuRen       = strBanZhuRen;
            info.BanZhuRenMobile = strBanZhuRenMobile;
            info.CellPhone       = strMobile;
            info.CityId          = intCityId;
            info.CountyId        = intCountyId;
            info.FuQinPhone      = strFMobile;
            info.GKYear          = intGKYear;
            info.MuQinPhone      = strMMobile;
            info.ProvinceId      = userinfo.ProvinceId;
            info.SchoolName      = strSchoolName;
            info.Sex             = intSex;
            info.StudentName     = strTrueName;
            info.WenLi           = intKeLei;

            if (userinfo.StudentLevel == 1)
            {
                info.StudentLevel = 1;
            }
            else if (userinfo.StudentLevel == 9)
            {
                info.StudentLevel = 2;
            }
            else
            {
                info.StudentLevel = 3;
            }

            bool b = DAL.TengXB.Join_Student.Join_StudentEdit_WanShanXinXi(info);


            if (b == true)
            {
                #region 重写cookie

                Basic.CookieHelper.WriteCookie("Student", "StudentName", strTrueName, 120);
                Basic.CookieHelper.WriteCookie("Student", "KeLei", intKeLei.ToString(), 120);
                Basic.CookieHelper.WriteCookie("Student", "GKYear", intGKYear.ToString(), 120);

                #endregion

                //提交成功,跳转路径
                // Basic.MsgHelper.AlertUrlMsg("提交成功", "#");
                Basic.MsgHelper.AlertUrlMsg("提交成功", "/TuiJian/default.aspx");
            }
            else
            {
                //提交失败
                Basic.MsgHelper.AlertBackMsg("提交失败");
            }
        }
Exemplo n.º 11
0
 //填充学生报告的基本信息
 public static Microsoft.Office.Interop.Word.Table BaseInfo(Microsoft.Office.Interop.Word.Table tb1, Entity.UserInfo userinfo, Entity.Join_Student user, string strKaHao)
 {
     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 = userinfo.ProvinceName;
         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());
     }
     return(tb1);
 }
Exemplo n.º 12
0
        /*点击提交*/
        protected void goSave_Click(object sender, EventArgs e)
        {
            //省份
            int intProvinceId = Basic.TypeConverter.StrToInt(ddlProvince.SelectedValue, userinfo.ProvinceId);

            if (intProvinceId == 0)
            {
                Basic.MsgHelper.AlertBackMsg("请选择省份");
            }
            int intCityId   = Basic.TypeConverter.StrToInt(hidCityId.Value, 0);   //城市
            int intCountyId = Basic.TypeConverter.StrToInt(hidCountyId.Value, 0); //区/县
            int intKeLei    = Basic.TypeConverter.StrToInt(hidKeLei.Value, 0);    //科类

            if (intKeLei == 0)
            {
                Basic.MsgHelper.AlertBackMsg("请选择高考分科");
            }

            int intGKYear = Basic.TypeConverter.StrToInt(ddlGKYear.SelectedValue, 0);//高考年份

            if (intGKYear == 0)
            {
                Basic.MsgHelper.AlertBackMsg("请选择高考年份");
            }

            string strTrueName = this.txtTrueName.Text;//真实姓名

            if (strTrueName == "")
            {
                Basic.MsgHelper.AlertBackMsg("请填写学生姓名");
            }
            int    intSex             = Basic.TypeConverter.StrToInt(ddlSex.SelectedValue, 0); //性别
            string strMobile          = this.txtMobile.Text;                                   //学生手机
            string strFMobile         = this.txtFMobile.Text;                                  //父亲手机
            string strMMobile         = this.txtMMobile.Text;                                  //母亲手机
            string strSchoolName      = this.txtSchoolName.Text;                               //就读学校
            string strBanJi           = this.txtBanJi.Text;                                    //就读班级
            string strBanZhuRen       = this.txtBanZhuRen.Text;                                //班主任姓名
            string strBanZhuRenMobile = this.txtBanZhuRenMobile.Text;                          //班主任手机

            Entity.Join_Student info = new Entity.Join_Student();

            bool b = false;

            if (userinfo.StudentLevel == 1) //普通注册用户
            {
                info                 = DAL.Join_Student.Join_StudentEntityGet(userinfo.StudentId);
                info.BanJi           = strBanJi;
                info.BanZhuRen       = strBanZhuRen;
                info.BanZhuRenMobile = strBanZhuRenMobile;
                info.CellPhone       = strMobile;
                info.CityId          = intCityId;
                info.CountyId        = intCountyId;
                info.FuQinPhone      = strFMobile;
                info.GKYear          = intGKYear;
                info.MuQinPhone      = strMMobile;
                info.ProvinceId      = intProvinceId;
                info.SchoolName      = strSchoolName;
                info.Sex             = intSex;
                info.StudentName     = strTrueName;
                info.WenLi           = intKeLei;
                info.StudentLevel    = 1;

                if (DAL.TengXB.Join_Student.Join_StudentEdit_WanShanXinXi(info))
                {
                    b = true;
                }
                else
                {
                    b = false;
                }
            }
            else  //高考卡用户
            {
                info.BanJi           = strBanJi;
                info.BanZhuRen       = strBanZhuRen;
                info.BanZhuRenMobile = strBanZhuRenMobile;
                info.CellPhone       = strMobile;
                info.CityId          = intCityId;
                info.CountyId        = intCountyId;
                info.FuQinPhone      = strFMobile;
                info.GKYear          = intGKYear;
                info.MuQinPhone      = strMMobile;
                info.ProvinceId      = intProvinceId;
                info.SchoolName      = strSchoolName;
                info.Sex             = intSex;
                info.StudentName     = strTrueName;
                info.WenLi           = intKeLei;

                info.StudentLevel = (userinfo.StudentLevel == 9 ? 2 : 3);//会员卡是2 高考卡3

                int intId = DAL.TengXB.Join_Student.Join_StudentAdd_WanShanXinXi(info);
                if (intId > 0)
                {
                    userinfo.StudentId = intId;

                    if (userinfo.StudentLevel == 9)
                    {
                        if (DAL.TengXB.Join_Card.SetJoin_CardStudentId(intId, userinfo.Bank, intProvinceId))
                        {
                            b = true;
                        }
                        else
                        {
                            b = false;
                        }
                    }
                    else
                    {
                        if (DAL.GaoKaoCard.SetGaoKaoCardStudentId(intId, userinfo.Bank, intProvinceId))
                        {
                            b = true;
                        }
                        else
                        {
                            b = false;
                        }
                    }
                }
                else
                {
                    b = false;
                }
            }

            if (b == true)
            {
                #region 重写cookie

                Basic.CookieHelper.WriteCookie("Student", "StudentId", userinfo.StudentId.ToString(), 120);
                Basic.CookieHelper.WriteCookie("Student", "StudentLevel", userinfo.StudentLevel.ToString(), 120);
                Basic.CookieHelper.WriteCookie("Student", "StudentName", strTrueName, 120);

                Basic.CookieHelper.WriteCookie("Student", "ProvinceId", intProvinceId.ToString(), 120);
                Basic.CookieHelper.WriteCookie("Student", "ProvinceName", ddlProvince.SelectedItem.Text, 120);
                Basic.CookieHelper.WriteCookie("Student", "KeLei", intKeLei.ToString(), 120);
                Basic.CookieHelper.WriteCookie("Student", "GKYear", intGKYear.ToString(), 120);


                if (userinfo.StudentLevel == 1 || userinfo.StudentLevel == 9)//注册用户  或者  会员卡用户
                {
                    Basic.CookieHelper.WriteCookie("Student", "Status", "4", 120);
                }
                else if (userinfo.StudentLevel > 1 && userinfo.StudentLevel < 9)  //高考卡用户
                {
                    Basic.CookieHelper.WriteCookie("Student", "Status", "3", 120);
                }

                #endregion

                //提交成功,跳转路径
                // Basic.MsgHelper.AlertUrlMsg("提交成功", "#");
                Basic.MsgHelper.AlertUrlMsg("提交成功", "/TuiJian/default.aspx");
            }
            else
            {
                //提交失败
                Basic.MsgHelper.AlertBackMsg("提交失败");
            }
        }