예제 #1
0
        private DateTime getWashingTmeForClothing(TypeOfClothing typeOfClothing)
        {
            DateTime time = new DateTime();

            switch (typeOfClothing)
            {
            case TypeOfClothing.Clean:
                time = time.AddMinutes(1);
                break;

            case TypeOfClothing.VeryDirty:
                time = time.AddMinutes(10);
                break;

            case TypeOfClothing.SlightlyDirty:
                time = time.AddMinutes(3);
                break;

            case TypeOfClothing.Dirty:
                time = time.AddMinutes(6);
                break;

            default:
                time = time.AddMinutes(0);
                break;
            }

            return(time);
        }
예제 #2
0
        private void SetTypeOfClothing(int minuteElapsed)
        {
            TypeOfClothing clothing      = Clothes.TypeOfClothingInWashingTime;
            int            timeElapsed   = GetTimeFromTheNewChangeOfClothesType(minuteElapsed);
            int            timeNecessary = 0;
            int            ClothesId     = 0;

            switch (clothing)
            {
            case TypeOfClothing.Clean:
                timeNecessary = 0;
                ClothesId     = 5;
                break;

            case TypeOfClothing.SlightlyDirty:
                timeNecessary = 2;
                ClothesId     = 1;
                break;

            case TypeOfClothing.Dirty:
                timeNecessary = 3;
                ClothesId     = 2;
                break;

            case TypeOfClothing.VeryDirty:
                timeNecessary = 4;
                ClothesId     = 3;
                break;
            }

            if (timeElapsed == timeNecessary)
            {
                Clothes.setTypeOfClothingInWashingTime(ClothesId);
            }
        }
예제 #3
0
 private void ClothingSelected(TypeOfClothing type)
 {
     switch (type)
     {
         case TypeOfClothing.Jacket:
             AddJacketModal jacketModal = new AddJacketModal(ArticleSelected);
             jacketModal.Show();
             break;
         case TypeOfClothing.Shirt:
             AddShirtModal shirtModal = new AddShirtModal(ArticleSelected);
             shirtModal.Show();
             break;
         case TypeOfClothing.Pants:
             AddPantsModal pantsModal = new AddPantsModal(ArticleSelected);
             pantsModal.Show();
             break;
         case TypeOfClothing.Vest:
             AddVestModal vestModal = new AddVestModal(ArticleSelected);
             vestModal.Show();
             break;
         case TypeOfClothing.Miscellaneous:
             AddMiscModal miscModal = new AddMiscModal(ArticleSelected);
             miscModal.Show();
             break;
         case TypeOfClothing.Other:
             AddOtherModal otherModal = new AddOtherModal(ArticleSelected);
             otherModal.Show();
             break;
     }
 }
예제 #4
0
 public Clothes(int idTypeOfClothing)
 {
     InitialTypeOfClothing       = setTypeClothes(idTypeOfClothing);
     TypeOfClothingInWashingTime = InitialTypeOfClothing;
 }