Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //加载客户服务信息
         BLL.HKSJ_Services services = new BLL.HKSJ_Services();
         ServicesShow = services.GetModelList(string.Empty);
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            //首先判断用户是否已经登陆
            if (context.Session["user"] == null)
            {
                context.Response.Write("请您正常操作");
                return;
            }

            context.Response.ContentType = "text/plain";
            BLL.HKSJ_Services          serviceObj = new BLL.HKSJ_Services();
            List <Model.HKSJ_Services> list       = new List <Model.HKSJ_Services>();

            list = serviceObj.GetModelList(string.Empty);
            var data = new { total = 1, rows = list };

            //系列化
            System.Web.Script.Serialization.JavaScriptSerializer javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string jsonStr = javaScriptSerializer.Serialize(data);

            context.Response.Write(jsonStr);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //取出所有传过来的参数
            string CulContext = context.Request["contentCulture"];
            string name       = context.Request["name"];
            int    id         = context.Request["id"] == null ? 1 : int.Parse(context.Request["id"]);

            //新建对象
            BLL.HKSJ_Services   serviceObj = new BLL.HKSJ_Services();
            Model.HKSJ_Services service    = serviceObj.GetModel(id);
            //赋值
            service.Context = CulContext;
            service.Name    = name;
            //更新
            if (serviceObj.Update(service))
            {
                context.Response.Write("OK");
            }
            else
            {
                context.Response.Write("error");
            }
        }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //输出信息显示在前台
     BLL.HKSJ_Services server = new BLL.HKSJ_Services();
     ServicesShow = server.GetModelList(string.Empty);
 }