/// <summary> /// will execute the visitor class passed as parameter, to all the elements /// </summary> /// <param name="visitor"></param> public override void Accept(VisitorBase visitor) { foreach (var element in listElement) { if (element != null) { element.Accept(visitor); if (visitor.HasError()) { result.AddErrorsRange(visitor.GetErrors()); } } } foreach (var element in listElements) { if (element != null) { visitor.Visit(element); if (visitor.HasError()) { result.AddErrorsRange(visitor.GetErrors()); } } } }
public DataTable Visitor_AddEdit(VisitorBase visitor) { dtContainer = new DataTable(); dsContainer = new DataSet(); try { MyParameter[] myParams = { new MyParameter("@VisitorID", visitor.VisitorID), new MyParameter("@VisitorName", visitor.VisitorName), new MyParameter("@Description", visitor.Description), new MyParameter("@FromHoursMinutes", visitor.FromHoursMinutes), new MyParameter("@ToHoursMinutes", visitor.ToHoursMinutes), new MyParameter("@VisitorDate", visitor.VisitorDate), new MyParameter("@GroupIdentifier", visitor.GroupIdentifier), new MyParameter("@CreatedBy", visitor.CreatedBy) }; Common.Set_Procedures("Visitor_AddEdit"); Common.Set_ParameterLength(myParams.Length); Common.Set_Parameters(myParams); dtContainer = Common.Execute_Procedures_LoadData(); } catch (Exception ex) { throw ex; } return(dtContainer); }
/// <summary> /// 处理 /// </summary> public void Request(CRANE_ACTION_RECORD_X record) { try { HandlerProvider handlerProvider = new HandlerProvider(); ActionHandlerBase handler = handlerProvider.GetHandler(record); if (handler != null) { VisitorProvider visitorProvider = new VisitorProvider(); VisitorBase visitor = visitorProvider.GetVisitor(record); handler.Handle(visitor); } } catch (Exception e) { log.WriteLog(E_ProcessLogType.Error, "物重处理异常。" + e.Message); } try { record.DEAL_SYMBOL = 2; CalculateWeightService.Instance.Update_CRANE_ACTION_RECORD_X(record); } catch (Exception e) { log.WriteLog(E_ProcessLogType.Error, "更新动作记录异常。" + e.Message); } }
public VisitorBase GetVisitor(CRANE_ACTION_RECORD_X record) { WST wst = WstManager.MatchWst((int)record.COORD_X, (int)record.COORD_Y); if (wst != null) { VisitorBase visitor = GetVisitor(wst.FIELD2); visitor.Wst = wst; return(visitor); } else { return(new UnknowVisitor()); } }
public ActionResult Visitor_Filter(VisitorBase visitor) { actionResult = new ActionResult(); try { actionResult.dtResult = visitorDL.Visitor_Filter(visitor); if (actionResult.dtResult != null && actionResult.dtResult.Rows.Count > 0) { actionResult.IsSuccess = true; } } catch (Exception ex) { } return(actionResult); }
public DataTable Visitor_Load(VisitorBase visitor) { dtContainer = new DataTable(); dsContainer = new DataSet(); try { MyParameter[] myParams = { new MyParameter("@VisitorID", visitor.VisitorID) }; Common.Set_Procedures("Visitor_Load"); Common.Set_ParameterLength(myParams.Length); Common.Set_Parameters(myParams); dtContainer = Common.Execute_Procedures_LoadData(); } catch (Exception ex) { throw ex; } return(dtContainer); }
public override void Accept(VisitorBase visitor) { visitor.Visit(this); }
public abstract void Accept(VisitorBase visitor);
/// <summary> /// Accept a visitor to this node /// </summary> public void Accept(VisitorBase visitor) { visitor.Visit(this); }
public R Accept <R>(VisitorBase <R> v) { return(this.Root.Accept(v)); }
public void Accept(VisitorBase visitor) { inner.Accept(visitor); }
/// <summary> /// 处理 /// </summary> /// <param name="visitor"></param> public abstract void Handle(VisitorBase visitor);
/// <summary> /// 处理 /// </summary> /// <param name="visitor"></param> public override void Handle(VisitorBase visitor) { visitor.FullDrop(this); }
/// <summary> /// 处理 /// </summary> /// <param name="visitor"></param> public override void Handle(VisitorBase visitor) { visitor.EmptyHoist(this); }
/// <summary> /// 处理 /// </summary> /// <param name="visitor"></param> public override void Handle(VisitorBase visitor) { visitor.Pour(this); }
public override void Accept(VisitorBase visitor) { throw new NotImplementedException(); }
public IEnumerable <string> Map <U>(VisitorBase <U> visitor) where U : IEnumerable <string> { this.Result = visitor.Start().SelectMany(i => i); return(this.Result); }