예제 #1
0
        // GET: Customers/Details/5
        public ActionResult Details(int?id, string activeTab)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            switch (isAuthorized(id.Value))
            {
            case AuthState.NoAuth:
                return(View("NotAuthorized"));

            default:
                var s     = db.Read(id.Value);
                var model = new CustomerAssetypeViewModel()
                {
                    Customer = s,
                };

                if (model.Customer == null)
                {
                    return(HttpNotFound());
                }
                s = null;
                return(View(model));
            }
        }
예제 #2
0
        public ActionResult SortedAssets(int customerId, int typeId)
        {
            Customer c = db.Read(customerId);

            if (c == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var model = new CustomerAssetypeViewModel()
            {
                Customer     = c,
                SortedAssets = dbAsset.ReadAllWithFk(customerId).FindAll(x => x.Type.Id == typeId)
            };

            return(View(model));
        }