Exemplo n.º 1
0
        /// <summary>
        /// 同步制样 出样明细信息到集中管控
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public void SyncMakeDetail(Action <string, eOutputType> output)
        {
            int res = 0;

            foreach (ZY_Record_Tb entity in this.EquDber.Entities <ZY_Record_Tb>("where DataStatus=0 and PackCode!=0 order by StartTime desc"))
            {
                if (SyncToRCMakeDetail(entity))
                {
                    InfMakerRecord makeRecord = new InfMakerRecord
                    {
                        InterfaceType = CommonDAO.GetInstance().GetMachineInterfaceTypeByCode(this.MachineCode),
                        MachineCode   = this.MachineCode,
                        MakeCode      = entity.SampleID,
                        BarrelCode    = entity.PackCode,
                        YPType        = entity.SampleType,                  //AutoMakerDAO.GetInstance().GetKYMakeType(entity.SampleType.ToString()),
                        YPWeight      = entity.SamepleWeight,
                        StartTime     = entity.StartTime,
                        EndTime       = entity.EndTime,
                        MakeUser      = entity.UserName,
                        DataFlag      = 1
                    };
                    if (AutoMakerDAO.GetInstance().SaveMakerRecord(makeRecord))
                    {
                        entity.DataStatus = 1;
                        this.EquDber.Update(entity);
                        res++;
                    }
                }
            }

            output(string.Format("同步出样明细记录 {0} 条", res), eOutputType.Normal);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 保存制样明细记录
 /// </summary>
 public bool SaveMakerRecord(InfMakerRecord entity)
 {
     return(Dbers.GetInstance().SelfDber.Insert <InfMakerRecord>(entity) > 0 ? true : false);
 }