Example #1
0
 private void ExecuteChangeHC()
 {
     try
     {
         _selectedCmd = CommandType.ChangeHeightClass;
         string io = _dbservicewms.GetParameter("Place.IOStation");
         Operation = null;
         EnabledCC = false;
         _warehouse.DBService.CreateOrUpdateMaterialID(_activeTUID.ID, _activeTUID.DimensionClass % 2 + 1, null);
         _warehouse.DBService.AddCommand(new CommandMaterial
         {
             Task     = Database.Command.EnumCommandTask.CreateMaterial,
             Material = _activeTUID.ID,
             Source   = io,
             Target   = io,
             Info     = "modify",
             Status   = Database.Command.EnumCommandStatus.NotActive,
             Time     = DateTime.Now
         });
         _selectedCmd = CommandType.None;
     }
     catch (Exception e)
     {
         _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception,
                             string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
     }
 }
Example #2
0
 public override void Initialize(BasicWarehouse warehouse)
 {
     try
     {
         base.Initialize(warehouse);
         OperationName = "Store tray";
         TUID          = DBServiceWMS.GetTUIDOnPlaceID(DBServiceWMS.GetParameter("Place.IOStation")).ID;
     }
     catch (Exception e)
     {
         Warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception, e.Message);
         throw new Exception(string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
     }
 }
Example #3
0
 public override string this[string propertyName]
 {
     get
     {
         try
         {
             string validationResult = String.Empty;
             if (ValidationEnabled)
             {
                 switch (propertyName)
                 {
                 case "TUIDstr":
                     if (TUID == 0)
                     {
                         validationResult = ResourceReader.GetString("ERR_TUID");
                     }
                     else
                     {
                         var place = DBServiceWMS.FindPlaceByTUID(TUID);
                         if (place != null && place.PlaceID != DBServiceWMS.GetParameter("Place.IOStation"))
                         {
                             validationResult = ResourceReader.GetString("ERR_TUIDEXISTS");
                         }
                     }
                     break;
                 }
             }
             Validator.AddOrUpdate(propertyName, validationResult == String.Empty);
             AllPropertiesValid = Validator.IsValid();
             return(validationResult);
         }
         catch (Exception e)
         {
             Warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception,
                                string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
             Validator.AddOrUpdate(propertyName, false);
             AllPropertiesValid = Validator.IsValid();
             return(ResourceReader.GetString("ERR_EXCEPTION"));
         }
     }
 }
 public override void Initialize(BasicWarehouse warehouse)
 {
     try
     {
         base.Initialize(warehouse);
         if (RemoveTray)
         {
             OperationName = "Remove tray";
             TUIDstr       = DBServiceWMS.GetTUIDOnPlaceID(DBServiceWMS.GetParameter("Place.IOStation")).ID.ToString();
             EnableEntry   = false;
         }
         else
         {
             OperationName = "Bring tray";
             EnableEntry   = true;
         }
     }
     catch (Exception e)
     {
         Warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception, e.Message);
         throw new Exception(string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
     }
 }
Example #5
0
 public override string this[string propertyName]
 {
     get
     {
         try
         {
             string validationResult = String.Empty;
             if (ValidationEnabled)
             {
                 switch (propertyName)
                 {
                 case "Boxes":
                     string[] boxArray = Regex.Split(Boxes, @"[,|;\s\n]+");
                     _boxList.Clear();
                     foreach (var b in boxArray)
                     {
                         if (b != "")
                         {
                             if (DBServiceWMS.FindBoxByBoxID(b) == null)
                             {
                                 validationResult = ResourceReader.GetString("ERR_NOBOXID");
                             }
                             else if (DBServiceWMS.FindTUByBoxID(b) == null)
                             {
                                 validationResult = ResourceReader.GetString("ERR_TUBOXNOEXISTS");
                             }
                             else if (_boxList.Contains(b))
                             {
                                 validationResult = ResourceReader.GetString("ERR_TUBOXEXISTS");
                             }
                             else
                             {
                                 _boxList.Add(b);
                             }
                         }
                     }
                     if (validationResult != String.Empty)
                     {
                         _boxList.Clear();
                     }
                     else
                     {
                         var x = DBServiceWMS.GetTUIDsForBoxes(_boxList);
                         if (x.Count == 0)
                         {
                             validationResult = ResourceReader.GetString("ERR_NOTUID");
                         }
                         else if (x.Count > 1)
                         {
                             validationResult = ResourceReader.GetString("ERR_MANYTUIDFORBOXES");
                         }
                         else if (PickBox &&
                                  DBServiceWMS.GetPlaceWithTUID(x[0]).PlaceID != DBServiceWMS.GetParameter("Place.IOStation"))
                         {
                             validationResult = ResourceReader.GetString("ERR_BOXNOTONSTATION");
                         }
                     }
                     break;
                 }
             }
             Validator.AddOrUpdate(propertyName, validationResult == String.Empty);
             AllPropertiesValid = Validator.IsValid();
             return(validationResult);
         }
         catch (Exception e)
         {
             Warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception,
                                string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
             Validator.AddOrUpdate(propertyName, false);
             AllPropertiesValid = Validator.IsValid();
             return(ResourceReader.GetString("ERR_EXCEPTION"));
         }
     }
 }