Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //加载客户服务信息
         BLL.HKSJ_Clients clients = new BLL.HKSJ_Clients();
         ClientsShow = clients.GetModel(int.Parse(Request["id"]));
     }
 }
Esempio n. 2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int clientId = context.Request["id"] == null ? 0 : int.Parse(context.Request["id"]);

            BLL.HKSJ_Clients   clientService = new BLL.HKSJ_Clients();
            Model.HKSJ_Clients client        = new Model.HKSJ_Clients();
            client = clientService.GetModel(clientId);
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            context.Response.Write(serializer.Serialize(client));
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //加载客户服务信息
         BLL.HKSJ_Clients clients = new BLL.HKSJ_Clients();
         // ClientsShow = clients.GetModelList(string.Empty);
         int pageIndex  = Request["pageIndex"] == null ? 1 : Convert.ToInt32(Request["pageIndex"]);
         int pageSize   = Request["pageSize"] == null ? 10 : Convert.ToInt32(Request["pageSize"]);
         int totalCount = clients.GetRecordCount(string.Empty);
         ClientsShow = clients.DataTableToList(clients.GetListByPage(string.Empty, "id", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex).Tables[0]);
         NavPager    = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, totalCount);
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            BLL.HKSJ_Clients clientService = new BLL.HKSJ_Clients();

            int clientId = context.Request["clientID"] == null ? 0 : Convert.ToInt32(context.Request["clientID"]);

            //执行计算,对获取到的数据进行删除
            if (clientService.Delete(clientId))
            {
                context.Response.Write("OK");
            }
            else
            {
                context.Response.Write("Error");
            }
        }
Esempio n. 5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            BLL.HKSJ_Clients clientServices = new BLL.HKSJ_Clients();
            context.Response.ContentType = "text/plain";

            //获取参数实现用户的添加
            Model.HKSJ_Clients client = new Model.HKSJ_Clients();


            //var title = $("#
            //var softName = $
            //var liaisonPhone
            //var liaisonPeple
            //var date = $("#t
            //peple
            client.title        = context.Request["title"];
            client.softName     = context.Request["softName"];
            client.liaisonPhone = context.Request["liaisonPhone"];
            client.liaisonPeple = context.Request["liaisonPeple"];
            string str = context.Request["date"];

            client.date    = DateTime.Now;
            client.peple   = context.Request["peple"];
            client.content = context.Request["content"];


            if (client.title != "" && client.softName != "" && client.liaisonPhone != "" && client.liaisonPeple != "" && str != "" && client.peple != "" && client.content != "")
            {
                //实现给数据库中添加数据
                if (clientServices.Add(client) > 0)
                {
                    context.Response.Write("OK");
                }
                else
                {
                    context.Response.Write("error");
                }
            }
            else
            {
                context.Response.Write("LackOfRequeryItem");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            BLL.HKSJ_Clients   clientService = new BLL.HKSJ_Clients();
            Model.HKSJ_Clients client        = new Model.HKSJ_Clients();
            context.Response.ContentType = "text/plain";
            //id: RowUpdat
            //title: $("#t
            //softName: $(
            //liaisonPhone
            //liaisonPeple
            //date: $("#tx
            // peple: $("#t
            client.id           = context.Request["id"] == null ? 0 : int.Parse(context.Request["id"]);
            client.title        = context.Request["title"];
            client.softName     = context.Request["softName"];
            client.liaisonPhone = context.Request["liaisonPhone"];
            client.liaisonPeple = context.Request["liaisonPeple"];
            client.date         = context.Request["date"] == null ? DateTime.Now : Convert.ToDateTime(context.Request["date"]);
            client.peple        = context.Request["peple"];
            client.content      = context.Request["content"];

            if (client.title != "" && client.softName != "" && client.liaisonPhone != "" && client.liaisonPeple != "" && client.peple != "" && client.content != "")
            {
                //实现给数据库中添加数据
                if (clientService.Update(client))
                {
                    context.Response.Write("OK");
                }
                else
                {
                    context.Response.Write("error");
                }
            }
            else
            {
                context.Response.Write("LackOfRequeryItem");
            }
        }
Esempio n. 7
0
        public void ProcessRequest(HttpContext context)
        {
            //判断用户是否登录
            //首先判断用户是否已经登陆
            if (context.Session["user"] == null)
            {
                context.Response.Write("请您正常操作");
                return;
            }


            context.Response.ContentType = "text/plain";
            //page:2
            //rows:10
            //sort:ID
            //order:asc
            List <Model.HKSJ_Clients> list = new List <Model.HKSJ_Clients>();

            BLL.HKSJ_Clients clientService = new BLL.HKSJ_Clients();
            int pageIndex = context.Request["page"] == null ? 1 : int.Parse(context.Request["page"]);
            int pageSize  = context.Request["rows"] == null ? 5 : int.Parse(context.Request["rows"]);

            DataSet ds = clientService.GetListByPage("", "id", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex);

            list = clientService.DataTableToList(ds.Tables[0]);

            int total = clientService.GetRecordCount(string.Empty);

            var data = new { total = total, rows = list };

            JavaScriptSerializer TypicalClientJSon = new JavaScriptSerializer();

            string json = TypicalClientJSon.Serialize(data);

            context.Response.Write(json);
        }