Example #1
0
        /// <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());
                    }
                }
            }
        }
Example #2
0
 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);
 }
Example #3
0
        /// <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);
            }
        }
Example #4
0
        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());
            }
        }
Example #5
0
 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);
 }
Example #6
0
 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);
 }
Example #7
0
 public override void Accept(VisitorBase visitor)
 {
     visitor.Visit(this);
 }
Example #8
0
 public abstract void Accept(VisitorBase visitor);
Example #9
0
 /// <summary>
 /// Accept a visitor to this node
 /// </summary>
 public void Accept(VisitorBase visitor)
 {
     visitor.Visit(this);
 }
Example #10
0
 public R Accept <R>(VisitorBase <R> v)
 {
     return(this.Root.Accept(v));
 }
Example #11
0
 /// <summary>
 /// Accept a visitor to this node
 /// </summary>
 public void Accept(VisitorBase visitor)
 {
     visitor.Visit(this);
 }
Example #12
0
 public void Accept(VisitorBase visitor)
 {
     inner.Accept(visitor);
 }
Example #13
0
 /// <summary>
 /// 处理
 /// </summary>
 /// <param name="visitor"></param>
 public abstract void Handle(VisitorBase visitor);
Example #14
0
 /// <summary>
 /// 处理
 /// </summary>
 /// <param name="visitor"></param>
 public override void Handle(VisitorBase visitor)
 {
     visitor.FullDrop(this);
 }
Example #15
0
 /// <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);
 }
Example #17
0
 public override void Accept(VisitorBase visitor)
 {
     throw new NotImplementedException();
 }
Example #18
0
 public IEnumerable <string> Map <U>(VisitorBase <U> visitor) where U : IEnumerable <string>
 {
     this.Result = visitor.Start().SelectMany(i => i);
     return(this.Result);
 }