예제 #1
0
        //解析所在地区
        public static int GetProvinceIdByIp()
        {
            int ProvinceId = 0;

            Entity.AreaJson areaJsonInfo = GetAreaModel();

            if (areaJsonInfo != null)
            {
                if (areaJsonInfo.code == "0")
                {
                    // string area_id = areaJsonInfo.data.area_id;
                    string RegionId = areaJsonInfo.data.region_id;

                    DataTable dt = DAL.Province.ProvinceList("AdminCode='" + RegionId + "'");
                    if (dt.Rows.Count > 0)
                    {
                        ProvinceId = Basic.TypeConverter.StrToInt(dt.Rows[0]["ProvinceID"].ToString(), 0);
                    }
                }
            }
            else
            {
                //获取数据失败
            }

            return(ProvinceId);
        }
예제 #2
0
파일: Base.cs 프로젝트: srsman/gaokao2015
        void page_Loading(object sender, EventArgs e)
        {
            userinfo.StudentId    = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentId"), 0);
            userinfo.StudentLevel = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentLevel"), 0); //用户等级id:1普通注册用户;2高考查看卡; 3普通测试卡; 4普通卡;  5VIP测试卡;  6VIP卡;9会员卡
            userinfo.ProvinceId   = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "ProvinceId"), 0);   //省份id
            userinfo.KeLei        = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "KeLei"), 0);        //科类

            userinfo.GKYear       = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "GKYear"), 0);       //参加高考的年份
            userinfo.Status       = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "Status"), 0);       //登陆之后的状态值
            userinfo.StudentName  = Basic.CookieHelper.GetCookie("Student", "StudentName");                           //学生姓名
            userinfo.Bank         = Basic.CookieHelper.GetCookie("Student", "Bank");                                  //当前登陆的账号
            userinfo.LevelName    = Basic.CookieHelper.GetCookie("Student", "LevelName");                             //用户等级名称: 1普通注册用户;2高考查看卡; 3普通测试卡; 4普通卡;  5VIP测试卡;  6VIP卡;9会员卡
            userinfo.ProvinceName = Basic.CookieHelper.GetCookie("Student", "ProvinceName");                          //省份名称


            #region 新疆乌鲁木齐咨询中心的卡不能在喀什地区使用

            if (userinfo.ProvinceId == 72)//新疆乌鲁木齐咨询中心
            {
                Entity.AreaJson infoAreaJson = DAL.AnalysisArea.GetAreaModel();
                if (infoAreaJson != null)
                {
                    if (infoAreaJson.code == "0")
                    {
                        if (infoAreaJson.data.city_id == "653100")
                        {
                            //新疆乌鲁木齐咨询中心的卡不能在喀什地区使用
                            Basic.MsgHelper.AlertUrlMsg("该卡不能在喀什地区使用", "/logout.aspx");
                        }
                    }
                }
            }
            #endregion


            userinfo.KeLeiMingCheng = DAL.Common.GetKeLeiMingCheng(userinfo.KeLei); //科类名称


            provinceConfig = DAL.ProvinceConfig.ProvinceConfigEntityGet(userinfo.ProvinceId);

            //userinfo.StudentId = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentId"), 5);
            //userinfo.StudentLevel = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentLevel"), 4);//用户等级id:1普通注册用户;2高考查看卡; 3普通测试卡; 4普通卡;  5VIP测试卡;  6VIP卡;9会员卡
            //userinfo.ProvinceId = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "ProvinceId"), 3);//省份id
            //userinfo.KeLei = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "KeLei"), 5);//科类
            //userinfo.GKYear = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "GKYear"), 2014);//参加高考的年份
            //userinfo.Status = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "Status"), 1);//登陆之后的状态值


            Status(); //根据状态  判定去向
        }
예제 #3
0
        public static Entity.AreaJson GetAreaModel()
        {
            //重新请求数据
            string ip = HttpContext.Current.Request.UserHostAddress;
            //请求数据

            string formUrl = "http://ip.taobao.com/service/getIpInfo.php?ip=" + ip;

            CookieContainer cookieContainer = new CookieContainer();
            HttpWebRequest  request         = (HttpWebRequest)HttpWebRequest.Create(formUrl);

            string jsonCode = string.Empty;


            request.Method            = "GET";
            request.KeepAlive         = false;
            request.AllowAutoRedirect = true;
            request.ContentType       = "application/x-www-form-urlencoded";
            request.UserAgent         = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR  2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR  3.0.4506.2152; .NET CLR 3.5.30729)";
            request.CookieContainer   = cookieContainer;
            HttpWebResponse SendSMSResponse = (HttpWebResponse)request.GetResponse();

            if (SendSMSResponse.StatusCode == HttpStatusCode.OK)
            {
                StreamReader SendSMSResponseStream = new StreamReader(SendSMSResponse.GetResponseStream());

                ////在这儿处理返回的文本就OK了,如:
                jsonCode = SendSMSResponseStream.ReadToEnd();

                JavaScriptSerializer js = new JavaScriptSerializer();//将json格式的数据jsont转换为Model.WebSet实体类对象

                //return null;
                Entity.AreaJson arjson = js.Deserialize <Entity.AreaJson>(jsonCode);

                SendSMSResponse.Close();
                SendSMSResponseStream.Close();

                if (arjson != null)
                {
                    //对象获取成功
                    return(arjson);
                }
            }

            return(null);
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int ProvinceId = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "ProvinceId"), 0); //省份id

            if (ProvinceId == 72)                                                                            //新疆乌鲁木齐咨询中心
            {
                Entity.AreaJson infoAreaJson = DAL.AnalysisArea.GetAreaModel();
                if (infoAreaJson != null)
                {
                    if (infoAreaJson.code == "0")
                    {
                        if (infoAreaJson.data.city_id == "653100")
                        {
                            //新疆乌鲁木齐咨询中心的卡不能在喀什地区使用
                            Basic.MsgHelper.AlertUrlMsg("该卡不能在喀什地区使用", "/logout.aspx");
                        }
                    }
                }
            }
        }
예제 #5
0
        void page_Loading(object sender, EventArgs e)
        {
            #region 用户登录信息
            userinfo.StudentId    = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentId"), 0);
            userinfo.StudentLevel = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentLevel"), 0); //用户等级id:1普通注册用户;2高考查看卡; 3普通测试卡; 4普通卡;  5VIP测试卡;  6VIP卡;9会员卡
            userinfo.ProvinceId   = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "ProvinceId"), 0);   //省份id
            userinfo.KeLei        = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "KeLei"), 0);        //科类
            userinfo.GKYear       = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "GKYear"), 0);       //参加高考的年份
            userinfo.Status       = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "Status"), 0);       //登陆之后的状态值
            userinfo.StudentName  = Basic.CookieHelper.GetCookie("Student", "StudentName");                           //学生姓名
            userinfo.Bank         = Basic.CookieHelper.GetCookie("Student", "Bank");                                  //当前登陆的账号
            userinfo.LevelName    = Basic.CookieHelper.GetCookie("Student", "LevelName");                             //用户等级名称: 1普通注册用户;2高考查看卡; 3普通测试卡; 4普通卡;  5VIP测试卡;  6VIP卡;9会员卡
            userinfo.ProvinceName = Basic.CookieHelper.GetCookie("Student", "ProvinceName");                          //省份名称

            //userinfo.StudentId = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentId"), 5);
            //userinfo.StudentLevel = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "StudentLevel"), 4);//用户等级id:1普通注册用户;2高考查看卡; 3普通测试卡; 4普通卡;  5VIP测试卡;  6VIP卡;9会员卡
            //userinfo.ProvinceId = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "ProvinceId"), 3);//省份id
            //userinfo.KeLei = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "KeLei"), 5);//科类
            //userinfo.GKYear = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "GKYear"), 2014);//参加高考的年份
            //userinfo.Status = Basic.Utils.StrToInt(Basic.CookieHelper.GetCookie("Student", "Status"), 1);//登陆之后的状态值

            userinfo.ProvinceName   = DAL.Common.GetProvinceName(userinfo.ProvinceId);
            userinfo.KeLeiMingCheng = DAL.Common.GetKeLeiMingCheng(userinfo.KeLei);
            #endregion


            #region 新疆乌鲁木齐咨询中心的卡不能在喀什地区使用

            if (userinfo.ProvinceId == 72)//新疆乌鲁木齐咨询中心
            {
                Entity.AreaJson infoAreaJson = DAL.AnalysisArea.GetAreaModel();
                if (infoAreaJson != null)
                {
                    if (infoAreaJson.code == "0")
                    {
                        if (infoAreaJson.data.city_id == "653100")
                        {
                            //新疆乌鲁木齐咨询中心的卡不能在喀什地区使用
                            Basic.MsgHelper.AlertUrlMsg("该卡不能在喀什地区使用", "/logout.aspx");
                        }
                    }
                }
            }
            #endregion


            Status(); //根据状态  判定去向

            //根据登陆用户的省份,去取一下省份的志愿配置信息
            int ProvinceId = userinfo.ProvinceId;

            provinceConfig = DAL.ProvinceConfig.ProvinceConfigEntityGet(userinfo.ProvinceId);

            //测试数据
            //history.LeiJiRenShu = 1000;
            //history.RenShu = 99;
            //history.WeiCi = 900;
            //history.FenShu = 600;

            if (userinfo.ProvinceId == 11)//浙江
            {
                history_zhejiang = DAL.StudentGaoKaoHistory_ZheJiang.StudentGaoKaoHistory_ZheJiangEntityGetByStudentId(userinfo.StudentId);
                if (history_zhejiang == null)
                {
                    Basic.MsgHelper.AlertUrlMsg("请首先设置自己的考试成绩!", "/Persional/ChengJiEdit2.aspx"); //跳转到成绩输入页面
                }
                if (history_zhejiang.ZongFen1 == 0 && history_zhejiang.ZongFen2 == 0 && history_zhejiang.ZongFen3 == 0)
                {
                    Basic.MsgHelper.AlertUrlMsg("您的成绩设置有问题,请重新设置后使用", "/Persional/ChengJiEdit2.aspx");
                }

                //判断第几批次,批次线差
                fenshuxian = DAL.FenShuXian.FenShuXianEntityGet(ProvinceId, " AND KeLei = " + userinfo.KeLei);
                // studentChengJi = DAL.CommonTuiJian.GetZheJiangUserPiCi(fenshuxian, history_zhejiang.ZongFen1, provinceConfig.LatestProvinceWeiCiYear, ProvinceId, userinfo.KeLei);

                //if (studentChengJi.PiCi == 0)
                //    Basic.MsgHelper.AlertUrlMsg("您的成绩设置有问题,请重新设置后使用", "/Persional/ChengJiEdit2.aspx");

                //StudentChengJiPiCi = studentChengJi.PiCi;
                ////studentChengJi.PiCiMingCheng = DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                //if (StudentChengJiPiCi <= 3)
                //    StudentChengJiPiCiMingCheng = "本科" + StudentChengJiPiCiMingCheng;
            }
            else
            {
                history = DAL.StudentGaoKaoHistory.StudentGaoKaoHistoryEntityGet(userinfo.StudentId);

                //非浙江
                if (history == null)
                {
                    Basic.MsgHelper.AlertUrlMsg("请首先设置自己的考试成绩!", "/Persional/ChengJiEdit2.aspx"); //跳转到成绩输入页面
                }
                if (history.FenShu == 0)
                {
                    Basic.MsgHelper.AlertUrlMsg("您的成绩设置有问题,请重新设置后使用", "/Persional/ChengJiEdit2.aspx");
                }


                if (history.IsSetUpWeiCi == 0)
                {
                    Entity.ProvinceWeiCi infoProvinceWeiCi = null;
                    if (userinfo.ProvinceId == 10)//江苏
                    {
                        //if (history.FenShu < 180)
                        //{
                        //    history.FenShu = 180;
                        //}
                        infoProvinceWeiCi = DAL.ProvinceWeiCi.ProvinceWeiCiEntityGetByFenShu(history.FenShu, provinceConfig.LatestProvinceWeiCiYear, userinfo.ProvinceId, userinfo.KeLei);
                    }
                    else
                    {
                        infoProvinceWeiCi = DAL.ProvinceWeiCi.ProvinceWeiCiEntityGetByFenShu(history.FenShu, provinceConfig.LatestProvinceWeiCiYear, userinfo.ProvinceId, userinfo.KeLei);
                    }
                    if (infoProvinceWeiCi != null)
                    {
                        history.WeiCi = infoProvinceWeiCi.WeiCi;
                    }
                    else
                    {
                        Basic.MsgHelper.AlertUrlMsg("您设置的成绩有问题,请重新设置后使用", "/Persional/ChengJiEdit2.aspx");
                    }
                }

                //判断第几批次,批次线差
                fenshuxian = DAL.FenShuXian.FenShuXianEntityGet(ProvinceId, " AND KeLei = " + userinfo.KeLei);
                if (history.IsSetUpFenShuXian == 1)
                {
                    fenshuxian.PcFirst  = (history.PcFirst > 0 ? history.PcFirst : fenshuxian.PcFirst);
                    fenshuxian.PcSecond = (history.PcSecond > 0 ? history.PcSecond : fenshuxian.PcSecond);
                    fenshuxian.PcThird  = (history.PcThird > 0 ? history.PcThird : fenshuxian.PcThird);
                    fenshuxian.ZkFirst  = (history.PcZhuanKeFirst > 0 ? history.PcZhuanKeFirst : fenshuxian.ZkFirst);
                    fenshuxian.ZkSecond = (history.PcZhuanKeSecond > 0 ? history.PcZhuanKeSecond : fenshuxian.ZkSecond);
                }


                studentChengJi = DAL.CommonTuiJian.GetUserPiCi(fenshuxian, history.FenShu, provinceConfig.LatestProvinceWeiCiYear, ProvinceId, userinfo.KeLei);
                if (studentChengJi.PiCi == 0)
                {
                    Basic.MsgHelper.AlertUrlMsg("您的成绩设置有问题,请重新设置后使用", "/Persional/ChengJiEdit2.aspx");
                }

                StudentChengJiPiCi = studentChengJi.PiCi;
                //<%=DAL.Common.GetPiCiMingCheng(studentChengJi.PiCi) %>
                if (history.IsSetUpFenShuXian == 1)
                {
                    switch (StudentChengJiPiCi)
                    {
                    case 1:
                        if (history.PcFirst > 0)
                        {
                            studentChengJi.PiCiMingCheng = "预估" + DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                        }
                        break;

                    case 2:
                        if (history.PcSecond > 0)
                        {
                            studentChengJi.PiCiMingCheng = "预估" + DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                        }
                        break;

                    case 3:
                        if (history.PcThird > 0)
                        {
                            studentChengJi.PiCiMingCheng = "预估" + DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                        }
                        break;

                    case 4:
                        if (history.PcZhuanKeFirst > 0)
                        {
                            studentChengJi.PiCiMingCheng = "预估" + DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                        }
                        break;

                    case 5:
                        if (history.PcZhuanKeSecond > 0)
                        {
                            studentChengJi.PiCiMingCheng = "预估" + DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                        }
                        break;

                    default:
                        studentChengJi.PiCiMingCheng = DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                        break;
                    }
                }
                else
                {
                    studentChengJi.PiCiMingCheng = DAL.Common.GetPiCiName(StudentChengJiPiCi, userinfo.ProvinceId);
                }
                if (StudentChengJiPiCi <= 3)
                {
                    StudentChengJiPiCiMingCheng = "本科" + StudentChengJiPiCiMingCheng;
                }
            }
        }