public static void AppUsersCanBeQueriedTest()
        {
            IT.Load();
            List <AppUser> someUsers = GetTestUsers();

            var repo   = new AppUsersRepository(someUsers);
            var aUser  = repo.FirstOrDefault(u => u.FirstName == "Bob");
            var supers = repo.GetAll().Where(u => u.SecurityLevel > 1024).ToList();

            // Assert..
            if (supers.Count != 1 || supers.Single(u => u.FullName == "Chuck Norris") == null)
            {
                throw new InvalidOperationException();
            }

            if (aUser == null || aUser.FirstName != "Bob")
            {
                throw new InvalidOperationException();
            }

            if (aUser != repo.GetById(aUser.Id))
            {
                throw new InvalidOperationException();
            }
        }
Example #2
0
        public IActionResult Add(AddITViewModel addITViewModel)// pass the AddITVM from the GetForm into this Add(AddITVM called addITVM)
        {
            if (ModelState.IsValid)
            {
                IT newIT = new IT
                {
                    Name            = addITViewModel.Name,
                    Date            = addITViewModel.Date,
                    Email           = addITViewModel.Email,
                    Phonenumber     = addITViewModel.Phonenumber,
                    HomeAdd         = addITViewModel.HomeAdd,
                    DOB             = addITViewModel.DOB,
                    PassportDetails = addITViewModel.PassportDetails,
                    DriversLicense  = addITViewModel.DriversLicense,
                    SSN             = addITViewModel.SSN,
                    Card            = addITViewModel.Card,
                    CardLast4digits = addITViewModel.CardLast4digits,
                    Check           = addITViewModel.Check,
                    Cash            = addITViewModel.Cash
                };
                context.ITs.Add(newIT);
                context.SaveChanges();
            }


            //  Model.isValid
            //  If is valid
            //  Create a new IT Object
            //  Save it to the Db.

            // If not valid
            // Redirect to the Get Form pass back the AddItVM object that they filled.
            return(Redirect("/IT"));
        }
Example #3
0
        public IActionResult Edit(EditITViewModel editITViewModel)
        {
            if (ModelState.IsValid)
            {
                IT theIT = context.ITs.Single(c => c.ID == editITViewModel.ID);


                theIT.Name            = editITViewModel.Name;
                theIT.Date            = editITViewModel.Date;
                theIT.Email           = editITViewModel.Email;
                theIT.Phonenumber     = editITViewModel.Phonenumber;
                theIT.HomeAdd         = editITViewModel.HomeAdd;
                theIT.DOB             = editITViewModel.DOB;
                theIT.PassportDetails = editITViewModel.PassportDetails;
                theIT.DriversLicense  = editITViewModel.DriversLicense;
                theIT.SSN             = editITViewModel.SSN;
                theIT.Card            = editITViewModel.Card;
                theIT.CardLast4digits = editITViewModel.CardLast4digits;
                theIT.Check           = editITViewModel.Check;
                theIT.Cash            = editITViewModel.Cash;


                context.ITs.Update(theIT);
                context.SaveChanges();
                return(Redirect("/IT"));
            }
            else
            {
                return(View(editITViewModel));
            }
        }
Example #4
0
        public IActionResult Edit(int id)
        {
            IT theIT = context.ITs.Single(c => c.ID == id);
            EditITViewModel editITViewModel = new EditITViewModel(theIT);

            return(View(editITViewModel));
        }
Example #5
0
 public override void Excute()
 {
     get_par();
     IT.set_position(pos);
     AP.set_edited(true);
     AP.logFile("move succeeded");
 }
Example #6
0
        public void getQuestionTest()
        {
            IT it = new IT();

            it.Questions();
            Assert.AreEqual("Firewall in computer is used for:", it.getQuestion(6));
        }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 1000, movementMask))
            {
                motor.MoveToPoint(hit.point);
                RemoveFocus();
            }
        }
        if (Input.GetMouseButtonDown(1))
        {
            Ray ray = cam.ScreenPointToRay(
                Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100))
            {
                IT interactable = hit.collider.GetComponent <IT>();
                if (interactable != null)
                {
                    SetFocus(interactable);
                }
            }
        }
    }
Example #8
0
        public void getAnswerTest()
        {
            IT it = new IT();

            it.Questions();
            Assert.AreEqual("Mozilla", it.getAnswer(2, 3));
        }
Example #9
0
        public ActionResult DeleteConfirmed(int id)
        {
            IT iT = db.IT.Find(id);

            db.IT.Remove(iT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #10
0
        public void IT_Parsing_Success_Test_3()
        {
            string testITRaw = "teststring test</it>";

            IT parsedIT = new IT(testITRaw);

            Assert.AreEqual(false, parsedIT.ParsingSuccess);
        }
Example #11
0
        public void IT_Parsing_Success_Test_2()
        {
            string testITRaw = "<it id=\"1\">";

            IT parsedIT = new IT(testITRaw);

            Assert.AreEqual(false, parsedIT.ParsingSuccess);
        }
        public override void Excute()
        {
            get_par();

            IT.set_opacity(opa);
            AP.set_edited(true);
            AP.logFile("opacity succeeded");
        }
Example #13
0
 void RemoveFocus()
 {
     if (focus != null)
     {
         focus.OnDefocused();
         focus = null;
         motor.StopFollowing();
     }
 }
Example #14
0
 protected TermTrigger(FL atom, int index)
 {
     Debug.Assert(index >= 0 && index < atom.faf.ftt.Count());
     this.literal = atom;
     this.index   = index;
     term         = atom.faf.ftt[index];
     stringNCache = makeKey(atom, index);
     hashCache    = stringNCache.GetHashCode();
 }
Example #15
0
        public ActionResult SendIT(IT service)
        {
            UserDal dal = new UserDal();

            dal.it.Add(service); //in Memorey adding
            dal.SaveChanges();   //adding to DB from Memorey
            TempData["yes"] = "Thank you for contacting us – we will get back to you soon!";
            return(RedirectToAction("ShowMyIT", "Home"));
        }
Example #16
0
        public Main_Form()
        {
            InitializeComponent();              //

            //Christmas Message
            DateTime today = DateTime.Today;

            if (today.Month == 12 && today.Day == 24)
            {
                lblNoSelect.Text += "\n\nMERRY CHRISTMAS <3";
            }
            //Halloween Message
            else if (today.Month == 10 && today.Day == 31)
            {
                lblNoSelect.Text += "\n\nHAPPY HALLOWEEN >:D";
            }

            using (Graphics g = this.CreateGraphics())
            {
                // All tabs have the same height. So set height based on that and DPI setting.
                this.Height = (int)Math.Ceiling(_originalHeight * (g.DpiY / 96));
            }

            //expand all nodes from the beginning.
            foreach (TreeNode node in tvwEffects.Nodes)
            {
                if (node.Nodes.Count != 0)
                {
                    node.ExpandAll();
                }
            }

            //contains all the tabs linking them to their names with the nodes
            Tabs = new Dictionary <string, ITab>()
            {
                { "BG Gradient", new HDMA_Gradiant_GUI(false) },                //bg
                { "FG Gradient", new HDMA_Gradiant_GUI(true) },                 //fg
                { "Brightness", new HDMA_Brightness_GUI() },
                { "Waves", new HDMA_Waves_GUI() },
                { "Parallax", new HDMA_Parallax_GUI() },
                { "Windows", new HDMA_Windowing_GUI() },
                { "Mosaic", new HDMA_Mosaic_GUI() },
                { "Color Math", new Color_Math_GUI() },
            };

            foreach (ITab IT in Tabs.Values)
            {
                TabControl t = IT.GetTabControl();                      // \ 
                t.Location = new Point(0, 0);                           //  | Runs through all the GUIs and gets the TabControls
                t.Visible  = false;                                     //  | and adds them to the main control.
                splitContainer1.Panel2.Controls.Add(t);                 // /
            }

            //Setup the ComboBoxes containing the mulilayers
            SetupMulitlayerComboBoxes();
        }
Example #17
0
        public void IT_Initialize_Test_3()
        {
            string testITRaw = "<it></it>";
            string innerText = string.Empty;

            IT parsedIT = new IT(testITRaw);

            Assert.AreEqual(-1, parsedIT.ID);
            Assert.AreEqual(innerText, parsedIT.Content);
        }
Example #18
0
        public void IT_Initialize_Test_1()
        {
            string testITRaw = "<it id=\"1\">&lt;afr story=\"ub35\" id=\"ub32\"/&gt;</it>";
            string innerText = "&lt;afr story=\"ub35\" id=\"ub32\"/&gt;";

            IT parsedIT = new IT(testITRaw);

            Assert.AreEqual(1, parsedIT.ID);
            Assert.AreEqual(innerText, parsedIT.Content);
        }
        /* TESTS */
        public static void AppUsersCanBeGotFromService()
        {
            List <AppUser> someUsers = GetTestUsers();
            var            svc       = IT.GetService <AppUserService>(someUsers); // todo: how inject someUsers (context) into the repo via GetService?
            var            supers    = svc.GetSuperAdmins();

            if (supers.Count() != 1)
            {
                throw new InvalidOperationException();
            }
        }
Example #20
0
 public ActionResult Edit([Bind(Include = "Id,Attendance,Departure,EmployID")] IT iT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(iT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployID = new SelectList(db.Employs, "Id", "UserName", iT.EmployID);
     return(View(iT));
 }
Example #21
0
        public IActionResult Remove(int[] ITIds)
        {
            foreach (int itId in ITIds)
            {
                IT theIT = context.ITs.Single(c => c.ID == itId);
                context.ITs.Remove(theIT);
            }

            context.SaveChanges();

            return(Redirect("/"));
        }
    public static void Main(string[] args)
    {
        EmployeeSeparator employeeSeparator = new EmployeeSeparator();

        //Hooks between publisher and subscriber
        Finance finance = new Finance(employeeSeparator);

        //Hooks between publisher and subscriber
        IT it = new IT(employeeSeparator);

        employeeSeparator.Separate();
    }
Example #23
0
    void SetFocus(IT newFocus)
    {
        if (newFocus != focus)
        {
            if (focus != null)
            {
                focus.OnDefocused();
            }

            focus = newFocus;
            motor.FollowTarget(newFocus);
        }
        newFocus.OnFocused(transform);
    }
Example #24
0
        public T Get <T>(string key, string section = null, T defaultValue = default(T))
        {
            var id = IT.Id;

            Debug.WriteLine("tasst");
            Trace.TraceInformation("Configuration instance has id " + Id);
            Trace.TraceInformation("Configuration instance reports singleton It.Instance Id of " + id);

            base.Load();
            this.Load();
            IT.Load();

            return(default(T));
        }
Example #25
0
        // GET: IT/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IT iT = db.IT.Find(id);

            if (iT == null)
            {
                return(HttpNotFound());
            }
            return(View(iT));
        }
Example #26
0
    public List <DPoint> GetPath(DPoint startPoint, DPoint finishPoint)
    {
        List <DPoint>      way             = new List <DPoint> ();
        List <DCheckPoint> bestCheckPoints = new List <DCheckPoint> ();
//		List<DIteration> iterations = new List<DIteration>();
        DIteration iteration = new DIteration();

        iteration.AddPoint(startPoint, startPoint, 0);
        iterations.Add(iteration);
        DPoint currPoint = startPoint;

        while (true)
        {
            List <DCheckPoint> CPL = new List <DCheckPoint> ();
            foreach (DIteration IT in iterations)
            {
                DCheckPoint CP = IT.GetLessWeight();
                Debug.Log(CP.currPoint.name);
                //CP = (bestCheckPoints.Find (x => x.currPoint == CP.currPoint));

                if (bestCheckPoints.Count == 0)
                {
                    bestCheckPoints.Add(CP);
                    Debug.Log(bestCheckPoints.Count + "BEST");
                }


                foreach (DCheckPoint y in bestCheckPoints)
                {
                    if (y.currPoint == CP.currPoint)
                    {
                        Debug.Log("SAME");
                        break;
                    }
                    else
                    {
                        Debug.Log(CP.currPoint.name);
                        CPL.Add(CP);
                    }
                }
            }

            //CPL.Sort((x, y) => x.weight);
            //Debug.Log (CPL[0].weight);
            break;
        }

        return(way);
    }
Example #27
0
        // GET: IT/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IT iT = db.IT.Find(id);

            if (iT == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployID = new SelectList(db.Employs, "Id", "UserName", iT.EmployID);
            return(View(iT));
        }
Example #28
0
 private bool upToDate(IT t)
 {
     if (t is GT)
     {
         return(upToDate(t as GT));
     }
     else if (t is FVT)
     {
         return(true);
     }
     else
     {
         return(upToDate((t as FFA).ftt));
     }
 }
Example #29
0
        public async Task Save()
        {
            if (!await CanSave().ConfigureAwait(false))
            {
                return;
            }

            var svc = IT.GetService <AppUserService>(GetDataContext());
            await svc.SaveAppUser(this).ConfigureAwait(false);

            // put into permanent storage
            // notify any watchers
            // log
            throw new NotImplementedException();
        }
 public EditITViewModel(IT it)
 {
     ID              = it.ID;
     Name            = it.Name;
     Date            = it.Date;
     Email           = it.Email;
     Phonenumber     = it.Phonenumber;
     HomeAdd         = it.HomeAdd;
     DOB             = it.DOB;
     PassportDetails = it.PassportDetails;
     DriversLicense  = it.DriversLicense;
     SSN             = it.SSN;
     Card            = it.Card;
     CardLast4digits = it.CardLast4digits;
     Check           = it.Check;
     Cash            = it.Cash;
 }
Example #31
0
 public F(IA a, IS s, IT t)
 {
     s.Result += a.Process;
     a.Result += t.Process;
 }