Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            // context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            //int empid = 1;
            int empid = Convert.ToInt32(context.Request.QueryString["empId"].ToString());
            EmployeeTableBll     ebll  = new EmployeeTableBll();
            List <EmployeeTable> elist = ebll.GetInfoE(empid);

            JavaScriptSerializer ejs = new JavaScriptSerializer();
            string eStr = ejs.Serialize(elist);

            context.Response.Write(eStr);
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            string data;

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

                data = EmployeeTableBll.stuLogin(phoneOrMail, pwd);
            }
            catch
            {
                data = "好像出了点问题";
            }
            context.Response.Write(data);
        }
Пример #3
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 = EmployeeTableBll.insertTable(phoneOrMail, pwd, isPhone);
            }
            catch
            {
                data = "好像出了点问题";
            }
            context.Response.Write(data);
        }
Пример #4
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());
        }