예제 #1
0
 public void TransferPallet(Pallet pallet, Slot from, Slot to)//Protocol to transfer pallet to different slot
 {
     if (to.isEmpty)
     {
         if (to.CubicHeight > pallet.CubicFeet)
         {
             to.assign(pallet);
             from.unAssign();
         }
     }
     else
     {
         throw new Exception("that slot is occupied would you like to tranfer it?");//create dialogue for transfer?
     }
     WHctx.SaveChanges();
 }
예제 #2
0
 public void assign(Pallet p)
 {
     if (isEmpty)
     {
         if (p.CubicFeet <= CubicHeight)
         {
             Pallet           = p;
             isEmpty          = false;
             p.Assigned       = true;
             p.Product.SlotId = Id;
         }
         else
         {
             throw new Exception("this pallet is too tall for this particular slot");
         }
     }
 }
예제 #3
0
 public void AssignPallet(Pallet pallet, Slot to)//necessary only for receiving
 {
     if (to.isEmpty && to.SType == SlotType.Reserve)
     {
         if (to.CubicHeight > pallet.CubicFeet)
         {
             to.assign(pallet);
             pallet.Assigned = true;
         }
     }
     else
     {
         if (to.isEmpty == false)
         {
             throw new Exception("that slot is currently occupied");
         }
         else if (to.SType != SlotType.Reserve)
         {
             throw new Exception("this is not a reserve slot");
         }
     }
     WHctx.SaveChanges();
 }