コード例 #1
0
        public void CanLoadState()
        {
            var repo   = new StateRepositoryADO();
            var states = repo.GetAll();

            Assert.AreEqual("MN", states[0].StateId);
        }
コード例 #2
0
ファイル: AdoTests.cs プロジェクト: smabbett/guild-cars
        public void CanLoadStates()
        {
            var repo = new StateRepositoryADO();

            var states = repo.GetAll();

            Assert.AreEqual(25, states.Count);
            Assert.AreEqual("AR", states[2].StateID);
            Assert.AreEqual("Minnesota", states[22].StateName);
        }
コード例 #3
0
        public void CanLoadStates()
        {
            var repo = new StateRepositoryADO();

            var states = repo.GetAll();

            Assert.AreEqual(3, states.Count);
            Assert.AreEqual("KY", states[0].StateID);
            Assert.AreEqual("Kentucky", states[0].Name);
        }
コード例 #4
0
        public ActionResult Details(int id)
        {
            var repo       = new MobileSuitRepositoryADO();
            var modelfirst = repo.GetDetails(id);
            var model      = new SalesViewModel();
            var statesrepo = new StateRepositoryADO();

            model.States = new SelectList(statesrepo.GetAll(), "StateId", "Name");
            var purchaseRepo = new PurchaseRepoADO();

            model.Purchase = new SelectList(purchaseRepo.GetAll(), "TypeId", "Type");


            model.MobileSuit = modelfirst;
            if (User.Identity.IsAuthenticated)
            {
                var user = User.Identity;
                ViewBag.Name = user.Name;

                ViewBag.displayMenu = "No";

                if (IsAdminUser())
                {
                    ViewBag.displayMenu = "Yes";
                }
                if (Request.IsAuthenticated)
                {
                    ViewBag.UserId = AuthorizeUtilities.GetUserId(this);
                }
                return(View(model));
            }
            else
            {
                ViewBag.Name = "Not Logged IN";
                return(View(model));
            }
        }