protected void DeleteText(object sender, EventArgs e)
        {
            ScreenShotActions deleteData = new ScreenShotActions();
            TextTrigger textTrigger = new TextTrigger();

            deleteData.deleteTextTrigger(textTrigger.id);
        }
 protected void UpdateText(object sender, EventArgs e)
 {
     ScreenShotActions updateData = new ScreenShotActions();
         TextTrigger textTrigger = new TextTrigger()
         {
             triggerString = TriggerTB.Text,
             userName = UserDropDownList.Text
         };
        updateData.updateTextTrigger(textTrigger);
 }
        protected void SubmitNewText(object sender, EventArgs e)
        {
            //insert trigger
            ScreenShotActions data = new ScreenShotActions();
            TextTrigger textTrigger = new TextTrigger()
            {
                triggerString = TriggerTB.Text,
                userName = UserDropDownList.Text,
            };
            data.insertTextTrigger(textTrigger);

            //refresh the triggers to bring back down the new trigger
            RefreshTriggers(data);

            //clear text boxes for a new trigger to be entered
            Clear(TriggerTB);
        }
        public void textTriggerFullTest()
        {
            //insert
            ScreenShotActions target = new ScreenShotActions(true);
            TextTrigger textTrigger = new TextTrigger();
            textTrigger.userName = "******";
            textTrigger.userEmail = "TEST@";
            textTrigger.triggerString = "TEST";
            Guid id = target.insertTextTrigger(textTrigger);
            Assert.IsNotNull(id);

            //update
            string newVal = "BAYAD WERDS";
            var allTriggers = target.getAllTextTriggers();
            TextTrigger outTrigger = allTriggers.First(t => t.id.Equals(id));
            outTrigger.triggerString = newVal;
            target.updateTextTrigger(outTrigger);
            allTriggers = target.getAllTextTriggers();
            outTrigger = allTriggers.First(t => t.id.Equals(id));
            Assert.AreEqual(newVal, outTrigger.triggerString);

            //delete
            target.deleteTextTrigger(outTrigger.id);
            Assert.AreEqual(target.getAllTextTriggers().Count(t => t.id.Equals(id)), 0);
        }
 public void insertTextTriggerTest()
 {
     ScreenShotActions target = new ScreenShotActions(true);
     TextTrigger textTrigger = new TextTrigger();
     textTrigger.userName = "******";
     textTrigger.userEmail = "TEST@";
     textTrigger.triggerString = "TEST";
     Guid actual = target.insertTextTrigger(textTrigger);
     Assert.IsNotNull(actual);
 }
 public void updateTextTrigger(TextTrigger textTrigger)
 {
     throw new NotImplementedException();
 }
 public Guid insertTextTrigger(TextTrigger textTrigger)
 {
     throw new NotImplementedException();
 }
        private ScreenWatchData.TextTrigger textTriggerMapper(TextTrigger textTrigger)
        {
            ScreenWatchData.TextTrigger sTextTrigger = new ScreenWatchData.TextTrigger();
            sTextTrigger.id = textTrigger.id;
            sTextTrigger.userName = textTrigger.userName;
            sTextTrigger.userEmail = textTrigger.userEmail;
            sTextTrigger.triggerString = textTrigger.triggerString;

            return sTextTrigger;
        }