Beispiel #1
0
 public static void CreateDeliveryPoint(TirDeliveryPoint _model)
 {
     _model.ID = CurrentDeliveryPoints.Item1.Count > 0 ? CurrentDeliveryPoints.Item1.LastOrDefault().ID + 1 : 1;
     CurrentDeliveryPoints.Item1.Add(_model);
     CurrentDeliveryPoints.Item2.Add(API.shared.createCylinderColShape(_model.DeliveryPointPosition, 3, 4));
     CurrentDeliveryPoints.Item2.LastOrDefault().dimension = _model.DeliveryPointDimension;
     SaveChanges();
 }
Beispiel #2
0
        public static bool UpdateDeliveryPoint(TirDeliveryPoint _model)
        {
            var _Index = FindTirDeliveryPointIndexById(_model.ID);

            if (_Index < 0)
            {
                return(false);
            }
            try
            {
                CurrentDeliveryPoints.Item1.RemoveAt(_Index);
                CurrentDeliveryPoints.Item2.RemoveAt(_Index);
                CurrentDeliveryPoints.Item1.Insert(_Index, _model);
                CurrentDeliveryPoints.Item2.Insert(_Index, API.shared.createCylinderColShape(_model.DeliveryPointPosition, 3, 4));
                CurrentDeliveryPoints.Item2[_Index].dimension = _model.DeliveryPointDimension;
                SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                API.shared.consoleOutput(LogCat.Error, "UPDATEDELIVERYPOINT");
                return(false);
            }
        }