コード例 #1
0
        public JsonResult PopulateCustomers()
        {
            var customers = from cust in _customerTasks.GetListNotDeleted()
                            select new
            {
                Id           = cust.Id,
                CustomerName = cust.CustomerName + " - " + cust.CustomerPhone
            };

            ViewData["customers"] = customers;
            return(Json(customers, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public JsonResult PopulateCustomers()
        {
            IEnumerable <CustomerViewModel> customers = from cust in _customerTasks.GetListNotDeleted()
                                                        select new CustomerViewModel
            {
                CustomerID   = cust.Id,
                CustomerName = cust.CustomerName + " - " + cust.CustomerPhone
            };

            ViewData["customers"] = customers;
            return(Json(customers, JsonRequestBehavior.AllowGet));
        }