Ejemplo n.º 1
0
        public AjaxResult GetQuality(JObject jData)
        {
            AjaxResult result = new AjaxResult();

            try
            {
                var cQuality = jData.ToObject <AppQuality>();
                var dtos     = qualityService.GetQuality(cQuality.C_ID);
                var appQ     = AutoMapper.Mapper.Map <AppQuality>(dtos);
                List <AppQuality_STL_GRD> stlGrds = new List <AppQuality_STL_GRD>();
                if (dtos != null && dtos.QualityStlGrds != null && dtos.QualityStlGrds.Count > 0)
                {
                    foreach (var item in dtos.QualityStlGrds)
                    {
                        AppQuality_STL_GRD stlGrd = new AppQuality_STL_GRD();
                        stlGrd.BatchNO     = item.C_BATCH_NO;
                        stlGrd.N_OBJEC_WGT = item.N_OBJEC_WGT;
                        stlGrd.N_SHIP_WGT  = item.N_SHIP_WGT;
                        stlGrd.N_WGT       = item.N_WGT;
                        stlGrds.Add(stlGrd);
                    }
                    appQ.Details = stlGrds;
                }

                result.Code   = DoResult.Success;
                result.Result = JsonConvert.SerializeObject(appQ);
            }
            catch (Exception e)
            {
                result.Code   = DoResult.Failed;
                result.Result = e.Message;
            }
            return(result);
        }