/// <summary> /// 同步存样柜命令 /// </summary> /// <param name="output"></param> /// <returns></returns> public int SyncCYGCmd(Action <string, eOutputType> output) { int res = 0, resdetail = 0; foreach (InfCYGControlCMD item in Dbers.GetInstance().SelfDber.Entities <InfCYGControlCMD>("where DataFlag=0 and MachineCode=:MachineCode", new { MachineCode = this.MachineCode })) { foreach (InfCYGControlCMDDetail detail in item.CmdDetails) { Tb_Bolt bolt = this.EquDber.Entity <Tb_Bolt>("where Sample_Id=@Sample_Id", new { Sample_Id = detail.MakeCode }); if (bolt == null) { continue; } Tb_PreAction cmd = new Tb_PreAction(); cmd.SSName = DataToKYMachine(detail.MachineCode); cmd.Sample_Id = detail.MakeCode; cmd.Operate_Code = item.OperType == "取样" ? 2 : 3; cmd.Priority = 4; cmd.Bolt_Id = bolt.Bolt_Id; cmd.DoneState = 0; if (this.EquDber.Insert(cmd) > 0) { resdetail++; } } res++; item.DataFlag = 1; Dbers.GetInstance().SelfDber.Update(item); } output(string.Format("同步存样柜命令:{0}条,明细命令:{1}条)", res, resdetail), eOutputType.Normal); return(res); }
/// <summary> /// 发送存样柜命令 /// </summary> /// <param name="code"></param> /// <param name="machinecode"></param> /// <param name="operateCode"></param> /// <returns></returns> public bool SendCupboardCmd(string code, string machinecode, eOperateCode operateCode) { Tb_PreAction preAction = new Tb_PreAction(); preAction.SSName = machinecode; preAction.Sample_Id = code; preAction.Operate_Code = Convert.ToInt32(operateCode); preAction.Person_Id = 0; preAction.Priority = 7; preAction.DoneState = 0; return(false); }