public async Task <IActionResult> PostEatingGuide([FromBody] DeEatingGuideDetail model)
        {
            try
            {
                model.HeadId         = 1;
                model.UpdateDateTime = DateTime.Now;
                model.FoodGroupID    = BlFood.GetByCode(model.FoodCode, "es").FoodGroupID;

                foreach (var lang in BlAppLanguage.GetAll())
                {
                    model.LangCode        = lang.LangCode;
                    model.FoodDescription = BlFood.GetByCode(model.FoodCode, model.LangCode).FoodTitle;

                    BlEatingGuideDetail.Save(model);
                }

                return(Ok("Success"));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Beispiel #2
0
        public ApiResponse GetFood(string id)
        {
            var result = BlFood.GetByCode(id);

            return(result);
        }