コード例 #1
0
ファイル: ReservateController.cs プロジェクト: iJzFan/backup
 public dynamic SearchRegistedList(string searchText, string timeRange = "Today", int?stationId = null, int?departId = null, int?doctorId = null, int?pageIndex = 1, int?pageSize = 20)
 {
     try
     {
         var dts        = timeRange.ahDtUtil().TimeRange();
         int?registOpId = null;
         if (stationId == null)
         {
             stationId = UserSelf.StationId;
         }
         var model     = new BllCaller.TreatRegistBllCaller().SearchRegistList(searchText, dts.Item1, dts.Item2, stationId, departId, doctorId, registOpId, pageIndex.Value, pageSize.Value);
         var doctors   = _docrSvr.FindList(model.DataList.Select(m => m.EmployeeID.Value).ToList()).ToList();
         var rxdoctors = _docrSvr.FindList(model.DataList.Select(m => m.RxDoctorId.Value).ToList()).ToList();
         var rlt       = MyDynamicResult("");
         rlt.data = model.DataList.Select(m => new
         {
             RegisterId   = m.RegisterID,
             RegisterDate = m.RegisterDate?.ToString("yyyy-MM-dd"),
             m.RegisterFromName,
             m.RegisterSeq,
             m.RegisterSlot,
             StationId = m.StationID,
             m.StationName,
             Customer = new
             {
                 CustomerId = m.CustomerID,
                 m.CustomerName,
                 CustomerGender = m.Gender,
                 m.CustomerMobile,
                 CustomerEmail  = m.Email,
                 CustomerPicUrl = m.CustomerPhoto.ahDtUtil().GetCustomerImg(m.Gender)
             },
             Doctor = doctors.Select(a => new
             {
                 a.DoctorId,
                 a.DoctorName,
                 DoctorGender = a.Gender,
                 a.PostTitleName,
                 DoctorPicUrl = a.DoctorPhotoUrl.ahDtUtil().GetDoctorImg(a.Gender)
             }).FirstOrDefault(b => b.DoctorId == m.EmployeeID),
             RxDoctor = rxdoctors.Select(a => new
             {
                 a.DoctorId,
                 a.DoctorName,
                 DoctorGender = a.Gender,
                 a.PostTitleName,
                 DoctorPicUrl = a.DoctorPhotoUrl.ahDtUtil().GetDoctorImg(a.Gender)
             }).FirstOrDefault(b => b.DoctorId == m.EmployeeID)
         });
         rlt.pageIndex = pageIndex;
         rlt.pageSize  = pageSize;
         return(Ok(rlt));
     }
     catch (Exception ex) { return(Ok(MyDynamicResult(ex))); }
 }
コード例 #2
0
ファイル: NurseController.cs プロジェクト: iJzFan/backup
        public IActionResult SearchRegistList(string searchText, string timeRange = "Today", int?stationId = null, int?departId = null, int?doctorId = null, int pageIndex = 1, int pageSize = 20)
        {
            DateTime dt0 = DateTime.Today, dt1 = DateTime.Now;

            base.initialData_TimeRange(ref dt0, ref dt1, timeRange);
            base.initialData_Page(ref pageIndex, ref pageSize);
            if (stationId == null)
            {
                stationId = UserSelf.StationId;
            }

            //如果角色是药店护士
            int?registOpId = null;

            if (UserSelf.MyRoleNames.Contains("drugstore_nurse"))
            {
                registOpId = UserSelf.OpId;
            }
            var model = new BllCaller.TreatRegistBllCaller().SearchRegistList(searchText, dt0, dt1, stationId, departId, doctorId, registOpId, pageIndex, pageSize);

            return(PartialView("_pvRegistList", model));
        }