コード例 #1
0
        public JsonResult ClientList()
        {
            ClientHomeVM CH = new ClientHomeVM();
            var clientList = db.Clients.Select(c=> new 
            {
                ClientName = c.ClientName, 
                ClientPhone = c.Phone, 
                ClientFullAddress =c.Address +" "+c.City +" "+c.State+" "+c.ZipCode,
                ClientEmail = c.Email,
                ClientFax = c.Fax ,
                ClientAddress = c.Address,
                ClientCity = c.City,
                ClientState = c.State,
                ClientZipcode = c.ZipCode,
                BUildingID = c.ID

            }).ToList();
            var mydata = Json(clientList);
            return new JsonResult { Data = mydata, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
        }
コード例 #2
0
 public ActionResult ClientHome()
 {
     ClientHomeVM CH = new ClientHomeVM();
     CH.clients = db.Clients.ToList();
     return View(CH);
 }