Пример #1
0
        public void LendDate(HttpContext context)
        {
            string callback = context.Request["jsoncallback"];
            //当前页
            int startIndex = Convert.ToInt32(context.Request["startIndex"]);
            //页容量
            int pageSize = 999;//Convert.ToInt32(context.Request["pageSize"]);

            EmsModel.OrderEquipDetail Mod = new EmsModel.OrderEquipDetail();
            //Mod.Type = 3;
            //
            if (context.Request["Type"] != null)
            {
                Mod.Type = Convert.ToByte(context.Request["Type"]);
            }
            //
            if (context.Request["OrderId"] != null)
            {
                Mod.OrderId = Convert.ToInt32(context.Request["OrderId"]);
            }


            //序列化
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            EmsModel.JsonModel mod = new EmsBLL.OrderInfo().GetJsonModelByOrder(Mod, startIndex, pageSize);
            //输出Json
            HttpContext.Current.Response.Write(callback +
                                               "({\"result\":" + jss.Serialize(mod) + "})");

            HttpContext.Current.Response.End();
        }
        /// <summary>
        /// 由一行数据得到一个实体
        /// </summary>
        private EmsModel.OrderEquipDetail GetEmsModel(DbDataReader dr)
        {
            EmsModel.OrderEquipDetail EmsModel = new EmsModel.OrderEquipDetail();
            DbDataReaderToModel(EmsModel, dr);

            return(EmsModel
                   );
        }