public void TreeFresh(Ts tsTest) { treeView1.Nodes.Clear(); TreeNode tn1 = new TreeNode(); tn1.Tag = tsTest; tn1.Text = "TSID:" + tsTest.TSID; foreach (var tserrorcode in tsTest.tsErrorCodes) { TreeNode tn2 = new TreeNode(); tn2.Tag = tserrorcode; tn2.Text = tserrorcode.errorCode.ecdesc; if (tserrorcode.tsErrorCauses != null) { foreach (var tserrorcause in tserrorcode.tsErrorCauses) { TreeNode tn3 = new TreeNode(); tn3.Tag = tserrorcause; tn3.Text = tserrorcause.errorCodeSeason.ecsdesc; tn2.Nodes.Add(tn3); } } tn1.Nodes.Add(tn2); } treeView1.Nodes.Add(tn1); treeView1.ExpandAll(); }
public OperationResult SaveTs(Ts ts) { OperationResult operationResult=TsFormService.UpdateEntity(ts); return operationResult; }
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; }