コード例 #1
0
        public JsonResult GetAllMovementListWithName()
        {
            var result = from move in movementManager.GetAll()
                         join asset in assetManager.GetAll()
                         on move.AssetId equals asset.Id
                         join org in organizationManager.GetAll()
                         on move.OrganizationId equals org.Id
                         join branch in branchManager.GetAll()
                         on move.BranchId equals branch.Id
                         select new
            {
                id         = move.Id,
                date       = move.RegistrationDate,
                asset      = asset.Name,
                fromOrg    = move.OrganizationName,
                frombranch = move.BranchName,
                toorg      = org.Name,
                tobranch   = branch.Name,
                moveby     = move.MoveBy
            };

            var jsonitem = result.Select(c => new
            {
                c.id,
                c.date,
                c.asset,
                c.fromOrg,
                c.frombranch,
                c.toorg,
                c.tobranch,
                c.moveby
            });

            return(Json(new { data = jsonitem }, JsonRequestBehavior.AllowGet));
        }