Example #1
0
        public object query(int id = 2, string name = "name3")
        {
            //var ret1 = HttpContext.ApiInvoke<icustomer>(i => i.newone, name);
            var ret = HttpContext.ApiInvoke <icustomer, response_list>(i => i.query, id, name);

            return(ret);
        }
Example #2
0
        public object update()
        {
            var ret = HttpContext.ApiInvoke <icustomer, request_update, com_result>(i => i.update, new request_update()
            {
                id = 3, name = "new name"
            });

            return(ret);
        }
Example #3
0
        public object save()
        {
            var cust = new customer()
            {
                id = 3, name = "new name", age = 22, timestamp = DateTime.Now.Ticks, birthday = DateTime.Now.AddYears(-10)
            };
            var ret = HttpContext.ApiInvoke <icustomer, customer, com_result>(i => i.save, cust);

            return(ret);
        }
Example #4
0
        public JsonResult customer_list()
        {
            var ret = HttpContext.ApiInvoke <icustomer, response_list>(i => i.list);

            if (ret.Ok())
            {
                List <object> custs = new List <object>();
                foreach (var cust in ret.Response.list)
                {
                    custs.Add(new { id = cust.id, name = cust.name, age = cust.age });
                }
                return(Json(custs, JsonRequestBehavior.AllowGet));
            }
            return(Json(ret, JsonRequestBehavior.AllowGet));
        }
Example #5
0
        public object trigger()
        {
            var ret = HttpContext.ApiInvoke <icustomer>(i => i.trigger);

            return(ret);
        }
Example #6
0
        public object delete()
        {
            var ret = HttpContext.ApiInvoke <icustomer, int, com_result>(i => i.del, 4);

            return(ret);
        }
Example #7
0
        public object info()
        {
            var ret = HttpContext.ApiInvoke <icustomer, int>(i => i.info, 4);

            return(ret);
        }
Example #8
0
        public object query1(int id = 2, string name = "name3")
        {
            var ret = HttpContext.ApiInvoke <icustomer>(i => i.query, id, name);

            return(ret);
        }
Example #9
0
        public object queryname(string name = "name3")
        {
            var ret = HttpContext.ApiInvoke <icustomer, response_list>(i => i.querybyname, name);

            return(ret);
        }
Example #10
0
        public object customers()
        {
            var ret = HttpContext.ApiInvoke <icustomer, response_list>(i => i.list);

            return(ret);
        }
Example #11
0
        public object newone(string name = "new hyf one")
        {
            var ret = HttpContext.ApiInvoke <icustomer, response_list>(i => i.newone, name);

            return(ret);
        }