コード例 #1
0
        //   public string SetOrder([FromBody]string token, [FromBody]string orderTime, [FromBody]string orderAddress)
        public string SetOrderGet(string token, string orderTime, string orderAddress)

        {
            string result="";
            int? d;
            try
            {
                CultureInfo provider = CultureInfo.InvariantCulture;
                string format = "dd-MM-yyyy HH:mm";
                DateTime time = DateTime.ParseExact(orderTime,format,provider);

                using (TestDBEntities1 context = new TestDBEntities1())
                {
                    //  result = context.spCreateOrder(token, time, orderAddress,returnVal:d).ToString();
                 var dd= context.spCreateOrder1(token, time, orderAddress).FirstOrDefault();


                    result = dd.ToString(); 
                }
            }
            catch (Exception ex)
            {

                return ex.Message;
            }

            return result;
        }
コード例 #2
0
        // GET: api/Order
       
        
        public IEnumerable<spGetAllOrders_Result> GetOrders([FromBody]string token)
        {
          
            IEnumerable<spGetAllOrders_Result> result = null;
            using (TestDBEntities1 context = new TestDBEntities1())
            {
                //  result = context.spCreateOrder(token, time, orderAddress,returnVal:d).ToString();
                result = context.spGetAllOrders().ToArray();//< OrderInfoModel>();

                
               
            }


            return result;

            
        }