Пример #1
0
        public static string getSelectInfo(string id)
        {
            int    code    = 1;
            string message = "返回数据成功";
            string str3    = string.Empty;

            if (HttpContext.Current.Session["user_"] == null)
            {
                code    = 0;
                message = "您还没有登录,请您登录!";
                str3    = JsonConvert.SerializeObject(new
                {
                    code    = code,
                    message = message
                });
            }
            else
            {
                StudentsUser user = new StudentsUser();
                if (HttpContext.Current.Session["user_"] == null && id != "0")
                {
                    using (StudentsUserBLL bll = new StudentsUserBLL())
                    {
                        user = bll.GetEntity(int.Parse(id));
                    }
                }
                else if (HttpContext.Current.Session["user_"] != null)
                {
                    user = HttpContext.Current.Session["user_"] as StudentsUser;
                }
                List <Nation>    listNation      = new List <Nation>();    //民族列表
                List <ZZMM>      listZZMM        = new List <ZZMM>();      //政治面貌
                List <AreaCode_> listShiAreaCode = new List <AreaCode_>(); //城市列表
                List <KSLB>      listKslb        = new List <KSLB>();      //考生类别
                List <BYLB>      listBylb        = new List <BYLB>();      //毕业类别
                List <ZY>        listZy          = new List <ZY>();        //专业名称
                StudentInfo      stuInfo         = new StudentInfo();
                Wish             wish            = new Wish();             //考生志愿信息
                ZY Zy_ = new ZY();
                if (user != null)
                {
                    using (NationBLL bll = new NationBLL())
                    {
                        listNation = bll.getListNation();
                    }
                    using (ZZMMBLL bll = new ZZMMBLL())
                    {
                        listZZMM = bll.getZZMMList();
                    }
                    using (AreaCodeBLL bll = new AreaCodeBLL())
                    {
                        listShiAreaCode = bll.getShiAreaCode();
                    }
                    using (KSLBBLL bll = new KSLBBLL())
                    {
                        listKslb = bll.getListKslb();
                    }
                    using (BYLBBLL bll = new BYLBBLL())
                    {
                        listBylb = bll.getListBylb();
                    }
                    using (ZYBLL bll = new ZYBLL())
                    {
                        listZy = bll.getListZy();
                    }
                    using (StudentInfoBLL bll = new StudentInfoBLL())
                    {
                        stuInfo = bll.getEntity(user.Sfzh);
                        if (stuInfo != null)
                        {
                            HttpContext.Current.Session["PicPath_"] = stuInfo.PicPath;
                        }
                    }
                    using (WishBLL bll = new WishBLL())
                    {
                        wish = bll.getEntity(user.Sfzh);
                    }
                }
                else
                {
                    code    = 0;
                    message = "请您登陆后再填写详细信息!";
                }

                str3 = JsonConvert.SerializeObject(new
                {
                    code            = code,
                    message         = message,
                    listNation      = listNation,
                    ListZZMM        = listZZMM,
                    listShiAreaCode = listShiAreaCode,
                    listKslb        = listKslb,
                    listBylb        = listBylb,
                    listZy          = listZy,
                    user            = user,
                    stuInfo         = stuInfo,
                    wish            = wish,
                }
                                                   );
            }
            return(str3);
        }
Пример #2
0
        public static string getSelectInfo(string id)
        {
            int          code    = 1;
            string       message = "返回数据成功";
            StudentsUser user    = new StudentsUser();

            if (HttpContext.Current.Session["user_"] == null &&
                id != "0")
            {
                using (StudentsUserBLL bll = new StudentsUserBLL())
                {
                    user = bll.GetEntity(int.Parse(id));
                }
            }
            else if (HttpContext.Current.Session["user_"] != null)
            {
                user = HttpContext.Current.Session["user_"] as StudentsUser;
            }

            List <Nation>    listNation  = new List <Nation>();
            List <ZZMM>      listZZMM    = new List <ZZMM>();
            List <AreaCode_> shiAreaCode = new List <AreaCode_>();
            List <KSLB>      listKslb    = new List <KSLB>();
            List <BYLB>      listBylb    = new List <BYLB>();
            List <ZY>        listZy      = new List <ZY>();
            StudentInfo      info        = new StudentInfo();
            Wish             wish        = new Wish();

            if (user != null)
            {
                using (NationBLL bll = new NationBLL())
                {
                    listNation = bll.getListNation();
                }
                using (ZZMMBLL bll = new ZZMMBLL())
                {
                    listZZMM = bll.getZZMMList();
                }
                using (AfficheBLL bll = new AfficheBLL())
                {
                    shiAreaCode = bll.getShiAreaCode();
                }
                using (KSLBBLL bll = new KSLBBLL())
                {
                    listKslb = bll.getListKslb();
                }

                using (BYLBBLL bll = new BYLBBLL())
                {
                    listBylb = bll.getListBylb();
                }
                using (ZYBLL bll = new ZYBLL())
                {
                    listZy = bll.getListZy();
                }
                using (StudentInfoBLL bll = new StudentInfoBLL())
                {
                    info = bll.getEntity(user.Sfzh);
                }
                using (WishBLL bll = new WishBLL())
                {
                    wish = bll.getEntity(user.Sfzh);
                }
            }
            else
            {
                code    = 0;
                message = "请登录后在操作";
            }
            string str3 = JsonConvert.SerializeObject(new
            {
                code        = code,
                message     = message,
                listNation  = listNation,
                listZZMM    = listZZMM,
                shiAreaCode = shiAreaCode,
                listBylb    = listBylb,
                listKslb    = listKslb,
                listZy      = listZy,
                user        = user,
                info        = info,
                wish        = wish
            });

            return(str3);
        }