示例#1
0
        /// <summary>
        /// 临时类转换
        /// </summary>
        /// <param name="rCMakeDetail"></param>
        /// <returns></returns>
        private IList <SpotAssay> DataChange(IList <CmcsRCAssay> rCAssay)
        {
            IList <SpotAssay> spotAssays = new List <SpotAssay>();

            foreach (CmcsRCAssay item in rCAssay)
            {
                SpotAssay   entity    = new SpotAssay();
                CmcsRCAssay assay_old = czyHandlerDAO.GetAssayBySpotMakeId(item.MakeId);
                if (assay_old != null)
                {
                    entity.AssayCode = assay_old.AssayCode;
                }
                entity.SpotAssayCode = item.AssayCode;
                entity.AssayId       = item.Id;
                entity.AssayPoint    = item.AssayPoint;
                try
                {
                    entity.BackBatchDate = item.TheRcMake.TheRcSampling.TheInFactoryBatch.BACKBATCHDATE.ToString("yyyy-MM-dd HH:mm:ss");
                }
                catch
                {
                    entity.BackBatchDate = item.TheRcMake.UseTime.ToString("yyyy-MM-dd HH:mm:ss");
                }
                entity.CheckUser = item.AssayPle;
                entity.SpotCount = czyHandlerDAO.GetSpotCountBySpotMakeId(item.TheRcMake.Id, item.AssayCode);
                entity.CheckUser = item.AssayPle;
                entity.PrintTime = item.PrintTime.ToString("yyyy-MM-dd HH:mm:ss");
                spotAssays.Add(entity);
            }

            return(spotAssays);
        }
示例#2
0
        /// <summary>
        /// 加载明细记录
        /// </summary>
        private void LoadDetail()
        {
            IList <CmcsRCAssay> rCMakeDetails = czyHandlerDAO.GetSpotAssayByDate(DateTime.Now);
            IList <SpotAssay>   MakeDetails   = DataChange(rCMakeDetails);

            superGridControl1.PrimaryGrid.DataSource = MakeDetails;

            if (this.CurrentAssay == null)
            {
                return;
            }
            this.CurrentSpotAssay = DataChange(this.CurrentAssay);

            if (MakeDetails.Select(a => a.AssayId).ToList().IndexOf(this.CurrentSpotAssay.AssayId) == -1)
            {
                MakeDetails.Insert(0, CurrentSpotAssay);
                superGridControl1.PrimaryGrid.DataSource = MakeDetails;
            }
            else
            {
                MakeDetails = DataChange(rCMakeDetails);
                superGridControl1.PrimaryGrid.DataSource = MakeDetails;
                int index = MakeDetails.Select(a => a.AssayId).ToList().IndexOf(this.CurrentSpotAssay.AssayId);
                if (index > 0)
                {
                    ((GridRow)superGridControl1.PrimaryGrid.Rows[index]).CellStyles.Default.TextColor = Color.Blue;
                }
            }
        }
示例#3
0
        /// <summary>
        /// 临时类转换
        /// </summary>
        /// <param name="rCMakeDetail"></param>
        /// <returns></returns>
        private SpotAssay DataChange(CmcsRCAssay rCAssay)
        {
            SpotAssay   entity    = new SpotAssay();
            CmcsRCAssay assay_old = czyHandlerDAO.GetAssayBySpotMakeId(rCAssay.MakeId);

            if (assay_old != null)
            {
                entity.AssayCode = assay_old.AssayCode;
            }
            entity.SpotAssayCode = rCAssay.AssayCode;
            entity.AssayId       = rCAssay.Id;
            entity.AssayPoint    = rCAssay.AssayPoint;
            entity.BackBatchDate = rCAssay.TheRcMake.TheRcSampling != null?rCAssay.TheRcMake.TheRcSampling.TheInFactoryBatch.BACKBATCHDATE.ToString("yyyyMMdd HH:mm:ss") : rCAssay.TheRcMake.MakeStartTime.ToString("yyyyMMdd HH:mm:ss");

            entity.CheckUser = rCAssay.AssayPle;
            entity.SpotCount = czyHandlerDAO.GetSpotCountBySpotMakeId(rCAssay.TheRcMake.Id, rCAssay.AssayCode);
            entity.CheckUser = rCAssay.AssayPle;

            return(entity);
        }