Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            string data;

            try
            {
                string phoneOrMail = context.Request["phoneOrMail"].ToString();
                string pwd         = context.Request["pwd"].ToString();
                bool   isPhone     = Convert.ToBoolean(context.Request["isPhone"].ToString());

                data = StudentTableBll.insertTable(phoneOrMail, pwd, isPhone);
            }
            catch
            {
                data = "好像出了点问题";
            }
            context.Response.Write(data);
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            JavaScriptSerializer jss    = new JavaScriptSerializer();
            StudentTableBll      StuBll = new StudentTableBll();
            ResumeTableBll       reBll  = new ResumeTableBll();
            StringBuilder        sb     = new StringBuilder();
            int           id;
            List <Object> index = new List <Object>();
            string        user  = context.Request.Cookies["StuUserName"].Value.Replace("%40", "@");

            try
            {
                string s_Sex          = context.Request["s_Sex"].ToString();
                string s_Address      = context.Request["s_Address"].ToString();
                string s_Department   = context.Request["s_Department"].ToString();
                string s_Professional = context.Request["s_Professional"].ToString();
                string s_Phone        = context.Request["s_Phone"].ToString();
                string s_Email        = context.Request["s_Email"].ToString();
                string re_Edu         = context.Request["re_Edu"].ToString();
                string re_WorkTime    = context.Request["re_WorkTime"].ToString();
                string re_Skill       = context.Request["re_Skill"].ToString();
                string re_Describe    = context.Request["re_Describe"].ToString();
                index.Add(StuBll.getInfo(user, out id));
                if (StuBll.updateInfo(s_Sex, s_Address, s_Department, s_Professional, s_Phone, s_Email, user) && reBll.updateInfo(re_Edu, re_WorkTime, re_Skill, re_Describe, id))
                {
                    context.Response.Write("保存成功");
                }
            }
            catch
            {
                index.Add(StuBll.getInfo(user, out id));
                index.Add(reBll.getAll(id));
                try
                {
                    jss.Serialize(index, sb);
                }
                catch
                {
                    sb.Append("好像出了点错误");
                }

                context.Response.Write(sb.ToString());
            }
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            JavaScriptSerializer jss    = new JavaScriptSerializer();
            StudentTableBll      StuBll = new StudentTableBll();
            PTandCompanyBll      ptBll  = new PTandCompanyBll();
            StringBuilder        sb     = new StringBuilder();
            int           id;
            List <Object> index = new List <Object>();
            string        user  = context.Request.Cookies["StuUserName"].Value.Replace("%40", "@");

            index.Add(StuBll.getInfo(user, out id));
            index.Add(ptBll.getPass(id));
            try
            {
                jss.Serialize(index, sb);
            }
            catch
            {
                sb.Append("好像出了点错误");
            }

            context.Response.Write(sb.ToString());
        }
Exemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            string data;

            try
            {
                string phoneOrMail = context.Request["phoneOrMail"].ToString();
                string pwd         = context.Request["pwd"].ToString();

                data = StudentTableBll.stuLogin(phoneOrMail, pwd);
                //context.Session["stuName"] = "张三";

                HttpCookie mycookie = new HttpCookie("stuName");
                mycookie.Value   = phoneOrMail;
                mycookie.Expires = DateTime.Now.AddDays(3);
                //context.Response.Cookies.Add(mycookie);
                context.Response.AppendCookie(mycookie);
            }
            catch
            {
                data = "好像出了点问题";
            }
            context.Response.Write(data);
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            JavaScriptSerializer jss    = new JavaScriptSerializer();
            StudentTableBll      stuBll = new StudentTableBll();
            EmployeeTableBll     comBll = new EmployeeTableBll();
            StringBuilder        sb     = new StringBuilder();
            List <Object>        search = new List <Object>();

            int    page;
            string user;
            string userId;
            string userName;
            string ProfessionalOrName;
            string schoolOrAddress;
            string Phone;
            string type;
            string searchstr;

            try
            {
                searchstr = context.Request.QueryString["search"].ToString();
                user      = context.Request.QueryString["user"].ToString();
                try
                {
                    page = Convert.ToInt32(context.Request.QueryString["page"].ToString());
                }
                catch
                {
                    page = 1;
                }
                if (user == "stu")
                {
                    search.Add(stuBll.getAll(user, page, searchstr));
                }
                else
                {
                    search.Add(comBll.getAll(user, page, searchstr));
                }
                if (user == "stu")
                {
                    search.Add(stuBll.rowCount(searchstr));
                }
                else
                {
                    search.Add(comBll.rowCount(searchstr));
                }
            }
            catch
            {
                try
                {
                    user   = context.Request["user"].ToString();
                    userId = context.Request["userId"].ToString();
                    page   = Convert.ToInt32(context.Request["page"].ToString());
                    try
                    {
                        userName           = context.Request["stuName"].ToString();
                        ProfessionalOrName = context.Request["Professional"].ToString();
                        schoolOrAddress    = context.Request["school"].ToString();
                        Phone = context.Request["Phone"].ToString();
                        search.Add(stuBll.getAll(user, userId, page, userName, ProfessionalOrName, schoolOrAddress, Phone));
                    }
                    catch
                    {
                        userName           = context.Request["comName"].ToString();
                        ProfessionalOrName = context.Request["RealName"].ToString();
                        schoolOrAddress    = context.Request["Address"].ToString();
                        Phone = context.Request["comPhone"].ToString();
                        search.Add(comBll.getAll(user, userId, page, userName, ProfessionalOrName, schoolOrAddress, Phone));
                    }
                }
                catch
                {
                    try
                    {
                        user = context.Request["user"].ToString();
                    }
                    catch
                    {
                        user = context.Request.QueryString["user"].ToString();
                    }
                    try
                    {
                        page = Convert.ToInt32(context.Request.QueryString["page"].ToString());
                    }
                    catch
                    {
                        page = 1;
                    }
                    try
                    {
                        userId = context.Request["userId"].ToString();
                        type   = context.Request["type"].ToString();
                        if (user == "stu" && type == "del")
                        {
                            search.Add(stuBll.getAll(user, userId, page));
                        }
                        else if (user == "com" && type == "del")
                        {
                            search.Add(comBll.getAll(user, userId, page));
                        }
                    }
                    catch
                    {
                        if (user == "stu")
                        {
                            search.Add(stuBll.getAll(user, page));
                        }
                        else
                        {
                            search.Add(comBll.getAll(user, page));
                        }
                    }
                }


                if (user == "stu")
                {
                    search.Add(stuBll.rowCount());
                }
                else
                {
                    search.Add(comBll.rowCount());
                }
            }

            try
            {
                jss.Serialize(search, sb);
            }
            catch
            {
                sb.Append("好像出了点错误");
            }

            context.Response.Write(sb.ToString());
        }