/// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string SaveBreedHealthData([FromBody] BreedHealth model)
        {
            string issuccess = "false";

            try
            {
                var winceSer = new WinceDicService();
                winceSer.SaveBreedHealthData(model);
                issuccess = "true";
            }
            catch (Exception ex)
            {
            }

            return(issuccess);
        }
        /// <summary>
        /// 保存健康状况
        /// </summary>
        /// <param name="model"></param>
        public void SaveBreedHealthData(BreedHealth model)
        {
            var productBase = GetProProductByEpc(model.Epc);

            if (productBase != null)
            {
                var cultivationId = GetCultivationId(productBase.ProcessEPC);

                if (cultivationId != 0)
                {
                    var healthModel = new BreedHealthModel();

                    healthModel.CultivationEpc = model.Epc;
                    healthModel.CultivationID  = cultivationId;
                    healthModel.HealthState    = model.Health;
                    healthModel.Weather        = model.Weather;
                    healthModel.People         = "text";
                    healthModel.CheckTime      = DateTime.Now;

                    Context.BreedHealth.Add(healthModel);
                    Context.SaveChanges();
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// 保存健康状况
 /// </summary>
 /// <param name="model"></param>
 public void SaveBreedHealthData(BreedHealth model)
 {
     _winceDicAccess.SaveBreedHealthData(model);
 }