private void AddTsErrorCode() { TsErrorCode tc = new TsErrorCode(); tc.errorCode=(ErrorCode)listBox2.SelectedItem; tc.muser = Program.usercode; DateTime dt = DateTime.Now; tc.mtime = Convert.ToInt32(dt.Hour.ToString() + dt.Minute + dt.Second); tc.mdate = Convert.ToInt32(dt.Year.ToString() + dt.Month + dt.Day); Program.programContainer.GetExportedValue<FrmTsInputEdit>().currentTs.tsErrorCodes.Add(tc); tc.ts = Program.programContainer.GetExportedValue<FrmTsInputEdit>().currentTs; Program.programContainer.GetExportedValue<FrmTsInputEdit>().TreeFresh(); formStatus = Status.NOTHING; this.Hide(); }
public virtual OperationResult UpdateEntity(TsErrorCode tsErrorCode,bool isSave=true) { return tsErrorCodeRepository.Update(tsErrorCode,isSave); }
public virtual OperationResult AddEntity(TsErrorCode tsErrorCode,bool isSave=true) { return tsErrorCodeRepository.Insert(tsErrorCode,isSave); }
public OperationResult ActionNg(string card, string usercode, string rescode, string selectedEcg, string selectedEc) { OperationResult operationResult = ActionNgCheck(card,usercode,rescode,selectedEcg,selectedEc); if (operationResult.ResultType == OperationResultType.Error) return operationResult; //TBLSIMULATION Simulation simulation = SimulationFormService.Simulations().SingleOrDefault(s => s.RCARD == card); DateTime dt = DateTime.Now; simulation.LOTNO = null; simulation.PRODUCTSTATUS = "NG"; simulation.LACTION = "NG"; simulation.ACTIONLIST += "NG;"; simulation.NGTIMES += 1; simulation.MUSER =usercode; simulation.MDATE = Convert.ToInt32("" + dt.Year + dt.Day); simulation.MTIME = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); //tblsimulationreport SimulationReport simulationReport = new SimulationReport(simulation); //TBLTS Ts ts = new Ts(); // ts.TSID = card + DateTime.Now.ToString(); ts.rcard = card; ts.rcardseq = 1;//固定 ts.tcard = card; ts.tcardseq = 1;//固定 ts.scard = card; ts.scardseq = 1;//固定 ts.cardtype = "cardtype_product";//固定 ts.modelcode = simulation.MODELCODE; ts.itemcode = simulation.ITEMCODE; ts.mocode = simulation.MOCODE; ts.frmroutecode = simulation.ROUTECODE; ts.frmopcode = ResFormService.Ress().SingleOrDefault(r => r.RESCODE == rescode).Op.OPCODE; ts.frmsegcode = "ZJ"; ts.frmsscode = "A1"; ts.crescode = rescode; ts.shifttypecode = "OS"; ts.shiftcode = "OS1"; ts.tpcode = "OS1-01"; ts.shiftday = 20140624; ts.frmuser = usercode; ts.frmdate = Convert.ToInt32("" + dt.Year + dt.Day); ts.frmtime = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); ts.frminputtype = "tssource_onwip"; ts.tstimes += 1; //ts.tsstatus = TsStatus.NEW; ts.tsstatus = TsStatus.NEW; ts.tsdate = 0; ts.tstimes = 0; ts.confirmtime = 0; ts.confirmdate = 0; ts.transstatus = "none"; ts.muser = usercode; ts.mdate = Convert.ToInt32("" + dt.Year + dt.Day); ts.mtime = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); ts.frmmonth = dt.Month; ts.frmweek = dt.DayOfYear / 7 + 1; ts.frmoutroutecode = simulation.ROUTECODE; ts.moseq = simulation.MOSEQ; ts.tsrepairmdate = 0; ts.tsrepairmtime = 0; //TBLTSERRORCODE TsErrorCode tsErrorCode = new TsErrorCode(); tsErrorCode.ts = ts; tsErrorCode.errorCode = (ErrorCode) EcFormService.FindEntity("ecode1").AppendData; tsErrorCode.muser = usercode; tsErrorCode.mdate = Convert.ToInt32("" + dt.Year + dt.Day); tsErrorCode.mtime = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); //update tbllot //delete from tbllot2card //insert into tblonwip //update tblrptre allineqty //insert into tblrptre secg //insert into tblrptre allineecqty //insert into tblrpthisopqty SimulationReportFormService.AddEntity(simulationReport, false); TsFormService.AddEntity(ts, false); TsErrorCodeFormService.AddEntity(tsErrorCode); operationResult.Message = card +Properties.Resources.String_FrmGoodNGService_CollectSuccess; return operationResult; }