Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string studNo   = context.Request["studNo"].ToString();
            string studName = context.Request["studName"].ToString();
            string studSex  = context.Request["studSex"].ToString();
            string date     = context.Request["studBirthDay"].ToString();
            string classID  = context.Request["classID"].ToString();

            BLL.StudInfo   studServer   = new BLL.StudInfo();
            Model.StudInfo stud         = studServer.GetModel(studNo);
            DateTime       studBirthDay = Convert.ToDateTime(date == ""?stud.studBirthDay.ToString():date);

            stud.classID      = classID;
            stud.studName     = studName;
            stud.studNo       = studNo;
            stud.studSex      = studSex;
            stud.studBirthDay = studBirthDay;
            bool isSuccess = studServer.Update(stud);

            if (isSuccess)
            {
                context.Response.Write("ok");
            }
            else
            {
                context.Response.Write("不ok");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //studNo, studName, studSex, studBirthDay, classID
            string   studNo       = context.Request["studNo"].ToString();
            string   studName     = context.Request["studName"].ToString();
            string   studSex      = context.Request["studSex"].ToString();
            DateTime studBirthDay = Convert.ToDateTime(context.Request["studBirthDay"].ToString());
            string   classID      = context.Request["classID"].ToString();

            BLL.StudInfo   studServer = new BLL.StudInfo();
            Model.StudInfo stud       = new Model.StudInfo()
            {
                classID = classID, studBirthDay = studBirthDay, studName = studName, studNo = studNo, studSex = studSex
            };
            bool isSuccess = studServer.Add(stud);

            if (isSuccess)
            {
                context.Response.Write("ok");
            }
            else
            {
                context.Response.Write("不ok");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string id = context.Request["studNo"].ToString();

            BLL.StudInfo   studServer = new BLL.StudInfo();
            Model.StudInfo stud       = studServer.GetModel(id);
            string         json       = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(stud);

            context.Response.Write(json);
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string id = context.Request["studNo"].ToString();

            BLL.StudInfo studServer = new BLL.StudInfo();
            bool         isSuccess  = studServer.Delete(id);

            if (isSuccess)
            {
                context.Response.Write("ok");
            }
            else
            {
                context.Response.Write("不ok");
            }
        }
Beispiel #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            List <Model.StudInfo> studList = new List <Model.StudInfo>();

            BLL.StudInfo sutdServer = new BLL.StudInfo();

            int pageIndex  = int.Parse(context.Request["pageIndex"]);
            int pageSize   = 12;
            int totalCount = sutdServer.GetRecordCount(string.Empty);

            string pagination = CreatePagination.ShowPageNavigate(pageSize, pageIndex, totalCount);

            studList = sutdServer.GetModelList(string.Empty);
            int count       = sutdServer.GetRecordCount(string.Empty);
            var studDataSet = sutdServer.GetListByPage(string.Empty, "studNo", (pageIndex - 1) * pageSize, pageIndex * pageSize);

            studList = sutdServer.DataTableToList(studDataSet.Tables[0]);
            var    paginationAndJson = new { studList = studList, pagination = pagination };
            string json = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(paginationAndJson);

            context.Response.Write(json);
        }