コード例 #1
0
ファイル: BaseController.cs プロジェクト: Jaylala03/OJCMS
        /// <summary>
        /// Load Case Worker DropDownList Asynchronously
        /// </summary>
        /// <returns>Data in JSON</returns>
        public JsonResult LoadCaseWorkerListAjax(int caseID, int?caseMemberID, int?CaseMemberIds)
        {
            if (CaseMemberIds.HasValue && !caseMemberID.HasValue && CaseMemberIds.Value > 0)
            {
                caseMemberID = CaseMemberIds;
            }
            if (caseMemberID.HasValue && caseMemberID.Value > 0)
            {
                var caseWorker = workerRepository.FindAllByCaseMemberID(caseMemberID.Value);//.Select(item => new { ID = item.ID, Name = item.FirstName + " " + item.LastName });
                return(Json(caseWorker, JsonRequestBehavior.AllowGet));
            }

            else
            {
                var caseWorker = workerRepository.FindAllByCaseID(caseID);//.Select(item => new { ID = item.ID, Name = item.FirstName + " " + item.LastName });
                return(Json(caseWorker, JsonRequestBehavior.AllowGet));
            }
        }