Пример #1
0
        // GET: Customer/Details/5
        public ActionResult Details(int?SN)
        {
            if (SN == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Comm_Customer customer = CustomerModel.getCustomerBySN(Convert.ToInt32(SN));
            List <Vw_Pet> petList  = PetModel.getPetList().Where(o => o.customerSN == customer.SN).ToList();

            ViewBag.petList = petList;

            return(View(customer));
        }
Пример #2
0
        // GET: Pet
        public ActionResult Index(string keyWord = "")
        {
            List <Vw_Pet> petList = PetModel.getPetList();

            if (!keyWord.Equals(string.Empty))
            {
                petList = PetModel.getPetListByKeyWord(keyWord);
            }

            var result = petList.OrderBy(o => o.petSN).ToPagedList();

            return(View(result));
        }