示例#1
0
        public IHttpActionResult UpdateStock(string userId, string shopNo, int takeType, [FromBody] JArray data)
        {
            try
            {
                if (takeType == 0)
                {
                    MtFoodApiService service = new MtFoodApiService(userId, shopNo);
                    var res = service.SkuStock(data);

                    return(Json(res));
                }
                else
                {
                    EleFoodService service = new EleFoodService();
                    var            res     = service.SkuStock(userId, shopNo, data);

                    return(Json(res));
                }
            }
            catch (Exception e)
            {
                _log.DebugFormat("【系统错误】UpdateStock  信息{0}", e.Message);
                _log.DebugFormat("【系统错误】UpdateStock  信息{0}", e.GetOriginalException().Message);
                return(Json(Tools.ResultErr(e.Message)));
            }
        }
示例#2
0
        public IHttpActionResult GetFood(string userId, string shopNo, int takeType)
        {
            try
            {
                if (takeType == 0)
                {
                    MtFoodApiService service = new MtFoodApiService(userId, shopNo);
                    var res = service.List();

                    return(Json(res));
                }
                else
                {
                    EleFoodService service = new EleFoodService();
                    var            res     = service.List(userId, shopNo);

                    return(Json(res));
                }
            }
            catch (Exception e)
            {
                _log.DebugFormat("【系统错误】类型:GetFood  信息{0}", e.Message);
                _log.DebugFormat("【系统错误】类型:GetFood  信息{0}", e.GetOriginalException().Message);
                return(Json(Tools.ResultErr(e.Message)));
            }
        }