Ejemplo n.º 1
0
        public void TestAddToRebateList()
        {
            int    transactionID = 1;
            String rebatesBefore = RebateDB.GenerateRebateChecks();

            // Create Transaction
            int    salesID      = 1;
            int    itemID       = 1;
            int    itemQuantity = 1;
            double itemCost     = 2.29;
            // double rebatePercent = .05;
            // double totalRebate = itemQuantity * itemCost * rebatePercent;
            Product p1 = new Product("Diapers", itemID, itemCost);
            Tuple <Product, int>         tuple1 = new Tuple <Product, int>(p1, itemQuantity);
            List <Tuple <Product, int> > items  = new List <Tuple <Product, int> >();
            Transaction t1 = new Transaction(salesID, items);

            TransactionDB.AddTransaction(t1);

            // create a rebates controller and try to access the transaction and then rebate it. However, error with Transactions so fails
            Observer         ob         = new Observer((string s, State status) => { Assert.AreNotEqual(rebatesBefore, s); Assert.AreEqual(status, State.Rebate); });
            ReturnController controller = new ReturnController();

            controller.RegisterR(ob);
            controller.ProcessReturn(1, 1, 1);
        }
Ejemplo n.º 2
0
        public void TestProcessReturnInReturnController()
        {
            //Create observer
            Observer ob1 = new Observer((string s, State status) => {  });

            //add transaction through the transaction controller
            TransactionController controller = new TransactionController();

            controller.RegisterR(ob1);
            Tuple <int, int>         productIDTransactionTyple = new Tuple <int, int>(1, 1);
            List <Tuple <int, int> > tuples = new List <Tuple <int, int> >
            {
                productIDTransactionTyple
            };

            controller.CreateTransaction(tuples);

            //Create observer
            Observer ob = new Observer((string s, State status) => { Assert.AreEqual("Success! Items returned.", s); Assert.AreEqual(status, State.Return); });

            //add transaction through the transaction controller
            ReturnController returnController = new ReturnController();

            returnController.RegisterR(ob);
            returnController.ProcessReturn(1, 1, 1);
        }
Ejemplo n.º 3
0
 public AddToJournalWindow(JournalWindow window, UpdateJournalControl journalControl)
 {
     _journalWindow        = window;
     _returnController     = new ReturnController(window);
     _updateJournalControl = journalControl;
     InitializeComponent();
     if (_journalWindow.journalCB.Text == "Knæalloplastik")
     {
         overskriftL.Content = "Dagbog for knæalloplastik";
         scaleTB.Text        = "Hvor meget smerte oplever du i dit knæ på en skala fra 1 - 10 ?";
         vinkelTBL.Text      = "Hvor mange grader kan du bøje dit knæ i?";
     }
     else if (_journalWindow.journalCB.Text == "Hofte")
     {
         overskriftL.Content  = "Dagbog for hofte";
         scaleTB.Text         = "Hvor meget smerte oplever du i din hofte på en skala fra 1 - 10?";
         vinkelTBL.Visibility = Visibility.Collapsed;
     }
     else if (_journalWindow.journalCB.Text == "Albue")
     {
         overskriftL.Content = "Dagbog for albue";
         scaleTB.Text        = "Hvor meget smerte oplever du i din albue på en skala fra 1 - 10?";
         vinkelTBL.Text      = "Hvor mange grader kan du bøje din albue i?";
     }
 }
Ejemplo n.º 4
0
        public void TestRegisterRebateControllerObservber()
        {
            Observer         ob         = new Observer((string s, State status) => { Assert.IsTrue(true); });
            ReturnController controller = new ReturnController();

            controller.RegisterR(ob);
            controller.update("", State.Return);
        }
Ejemplo n.º 5
0
        public ExerciseWindow(HomeWindow window)
        {
            _returnController = new ReturnController(window);
            _exerciseControl  = new ExerciseControl(window);


            InitializeComponent();
            Browser.Visibility = Visibility.Collapsed;
        }
Ejemplo n.º 6
0
 public override void Init()
 {
     base.Init();
     this.returnController        = this.transform.GetComponent <ReturnController>();
     this.mAttackPriority         = this.transform.Find("ReturnPanel/NewPanel/Target");
     this.mChaOutline             = this.transform.Find("ReturnPanel/NewPanel/Hero/Btn").GetComponent <UIToggle>();
     this.mChaOutlineList         = this.transform.Find("ReturnPanel/NewPanel/OutlineList/Popup List").GetComponent <UIPopupList>();
     this.mGameBgm                = this.transform.Find("ReturnPanel/NewPanel/Music");
     this.mGameSfx                = this.transform.Find("ReturnPanel/NewPanel/Sound");
     this.mGameCameraSpeed        = this.transform.Find("ReturnPanel/NewPanel/CameraSpeed");
     this.mRecommend              = this.transform.Find("ReturnPanel/NewPanel/Recommend/Btn").GetComponent <UIToggle>();
     this.mShopToggle             = this.transform.Find("ReturnPanel/NewPanel/Shop/Btn").GetComponent <UIToggle>();
     this.ExitButton              = this.transform.Find("ReturnPanel/NewPanel/Surrender");
     this.ContinueButton          = this.transform.Find("BackPanel/BackBtn");
     this.fpsToggle               = this.transform.Find("ReturnPanel/NewPanel/FPS/Btn").GetComponent <UIToggle>();
     this.fpsLimitToggle          = this.transform.Find("ReturnPanel/NewPanel/FPSLimit/Btn").GetComponent <UIToggle>();
     this.cameraHeight            = this.transform.Find("ReturnPanel/NewPanel/Camera/Btn").GetComponent <UIToggle>();
     this.mControlMode            = this.transform.Find("ReturnPanel/NewPanel/Skill");
     this.mQuality_1080P          = this.transform.Find("ReturnPanel/NewPanel/Quality/Btn").GetComponent <UIToggle>();
     this.mQualityList            = this.transform.Find("ReturnPanel/NewPanel/QualityList/Popup List").GetComponent <UIPopupList>();
     this.mSkillPanelPivot_bottom = this.transform.Find("ReturnPanel/NewPanel/SkillPanelPivot/BtnBelow").gameObject;
     this.mSkillPanelPivot_left   = this.transform.Find("ReturnPanel/NewPanel/SkillPanelPivot/BtnLeft").gameObject;
     this.mSkillPanelPivot_right  = this.transform.Find("ReturnPanel/NewPanel/SkillPanelPivot/BtnRight").gameObject;
     UIEventListener.Get(this.ExitButton.gameObject).onClick     = new UIEventListener.VoidDelegate(this.Exit);
     UIEventListener.Get(this.ContinueButton.gameObject).onClick = new UIEventListener.VoidDelegate(this.Continue);
     UIEventListener.Get(this.fpsToggle.gameObject).onClick      = new UIEventListener.VoidDelegate(this.OnFPSBtn);
     UIEventListener.Get(this.fpsLimitToggle.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnFPSLiminiBtn);
     UIEventListener.Get(this.cameraHeight.gameObject).onClick   = new UIEventListener.VoidDelegate(this.OnCameraBtn);
     UIEventListener.Get(this.mRecommend.gameObject).onClick     = new UIEventListener.VoidDelegate(this.OnRecommendBtn);
     UIEventListener.Get(this.mShopToggle.gameObject).onClick    = new UIEventListener.VoidDelegate(this.OnShopToggle);
     UIEventListener.Get(this.mAttackPriority.FindChild("Btn").gameObject).onClick = new UIEventListener.VoidDelegate(this.onClick_AttackPriority);
     EventDelegate.Add(this.mChaOutline.onChange, new EventDelegate.Callback(this.OnChangeChaOutline));
     this.mChaOutline.value = GlobalSettings.Instance.isEnableChaOutline;
     EventDelegate.Add(this.mChaOutlineList.onChange, new EventDelegate.Callback(this.OnChangeChaOutlineList));
     if (GlobalSettings.Instance.ChaOutlineLevel == 0 && this.mChaOutlineList.value != "无")
     {
         this.mChaOutlineList.value = "无";
     }
     else if (GlobalSettings.Instance.ChaOutlineLevel == 1 && this.mChaOutlineList.value != "细")
     {
         this.mChaOutlineList.value = "细";
     }
     else if (GlobalSettings.Instance.ChaOutlineLevel == 2 && this.mChaOutlineList.value != "粗")
     {
         this.mChaOutlineList.value = "粗";
     }
     EventDelegate.Add(this.mQualityList.onChange, new EventDelegate.Callback(this.OnQualityBtn));
     UIEventListener.Get(this.mGameBgm.FindChild("Btn").gameObject).onClick = new UIEventListener.VoidDelegate(this.onClick_BgmToggle);
     UIEventListener.Get(this.mGameBgm.FindChild("Value/Slider/Thumb").gameObject).onDrag = new UIEventListener.VectorDelegate(this.onDrag_BgmProgBar);
     UIEventListener.Get(this.mGameSfx.FindChild("Btn").gameObject).onClick = new UIEventListener.VoidDelegate(this.onClick_SfxToggle);
     UIEventListener.Get(this.mGameSfx.FindChild("Value/Slider/Thumb").gameObject).onPress = new UIEventListener.BoolDelegate(this.onPress_SfxProgBar);
     UIEventListener.Get(this.mControlMode.FindChild("Btn").gameObject).onClick            = new UIEventListener.VoidDelegate(this.onClick_ControlModeToggle);
     UIEventListener.Get(this.mSkillPanelPivot_bottom).onClick = new UIEventListener.VoidDelegate(this.onClick_SkillPanelPivot);
     UIEventListener.Get(this.mSkillPanelPivot_left).onClick   = new UIEventListener.VoidDelegate(this.onClick_SkillPanelPivot);
     UIEventListener.Get(this.mSkillPanelPivot_right).onClick  = new UIEventListener.VoidDelegate(this.onClick_SkillPanelPivot);
 }
Ejemplo n.º 7
0
        public JournalWindow(HomeWindow window, Journal journal, Patient patient)
        {
            _patient          = patient;
            _journal          = journal;
            _homeWindow       = window;
            _returnController = new ReturnController(window);
            _journalControl   = new UpdateJournalControl(window, patient, journal);

            InitializeComponent();
            _journalControl.PrintJournal();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Constructor method.
        /// </summary>
        public Return()
        {
            InitializeComponent();
            this.returnController            = new ReturnController();
            this.returnTransactionController = new ReturnTransactionController();
            this.furnitureController         = new FurnitureController();
            rentalTransactionController      = new RentalTransactionController();

            this.employeeID           = EmployeeDashboard.employeeID;
            buttonReturn.Enabled      = false;
            buttonAddToReturn.Enabled = false;
            this.itemsToReturn        = new List <ReturnableItem>();
        }