Beispiel #1
0
        public async Task <ObjectResultModule> DoctorIncomePage([FromBody] DoctorIncomeIn DoctorIncomeInPage)
        {
            if (!Commons.CheckSecret(DoctorIncomeInPage.Secret))
            {
                this.ObjectResultModule.StatusCode = 422;
                this.ObjectResultModule.Message    = "Wrong Secret";
                this.ObjectResultModule.Object     = "";
                return(this.ObjectResultModule);
            }
            var userid      = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0;
            var usermanager = JsonHelper.FromJson <UserMemory>(_IabpSession.GetUserData());

            // 判断当角色为医生角色时
            if ((!usermanager.IsAdmin && usermanager.IsDoctor) || usermanager.MobileRoleName == "doctor")
            {
                if (DoctorIncomeInPage.Platform == "PC")
                {
                    DoctorIncomeInPage.AndAlso(t => t.DoctorID == usermanager.DoctorID);
                }
                else if (DoctorIncomeInPage.Platform == "Mobile")
                {
                    var doctor = await _yaeherDoctorService.YaeherDoctorByUserID(userid);

                    DoctorIncomeInPage.AndAlso(t => t.DoctorID == doctor.Id);
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(DoctorIncomeInPage.DoctorName))
                {
                    DoctorIncomeInPage.AndAlso(t => t.DoctorName.Contains(DoctorIncomeInPage.DoctorName));
                }
            }
            DoctorIncomeInPage.AndAlso(t => !t.IsDelete);
            var values = await _DoctorIncomeService.DoctorIncomePage(DoctorIncomeInPage);

            this.ObjectResultModule.Object     = new DoctorIncomeOut(values, DoctorIncomeInPage);
            this.ObjectResultModule.Message    = "sucess";
            this.ObjectResultModule.StatusCode = 200;
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "DoctorIncomePage",
                OperContent = JsonHelper.ToJson(DoctorIncomeInPage),
                OperType    = "DoctorIncomePage",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(this.ObjectResultModule);
        }
Beispiel #2
0
        public async Task <PagedResultDto <DoctorIncome> > DoctorIncomePage(DoctorIncomeIn DoctorIncomeInfo)
        {
            //初步过滤
            var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(DoctorIncomeInfo.Expression);
            //获取总数
            var tasksCount = query.Count();
            //获取总数
            var totalpage        = tasksCount / DoctorIncomeInfo.MaxResultCount;
            var DoctorIncomeList = await query.PageBy(DoctorIncomeInfo.SkipTotal, DoctorIncomeInfo.MaxResultCount).ToListAsync();

            return(new PagedResultDto <DoctorIncome>(tasksCount, DoctorIncomeList.MapTo <List <DoctorIncome> >()));
        }
Beispiel #3
0
        public async Task <ObjectResultModule> DoctorIncomeList([FromBody] DoctorIncomeIn DoctorIncomeInList)
        {
            if (!Commons.CheckSecret(DoctorIncomeInList.Secret))
            {
                this.ObjectResultModule.StatusCode = 422;
                this.ObjectResultModule.Message    = "Wrong Secret";
                this.ObjectResultModule.Object     = "";
                return(this.ObjectResultModule);
            }
            var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0;

            DoctorIncomeInList.AndAlso(t => !t.IsDelete);
            if (!string.IsNullOrEmpty(DoctorIncomeInList.DoctorName))
            {
                DoctorIncomeInList.AndAlso(t => t.DoctorName.Contains(DoctorIncomeInList.DoctorName));
            }

            var value = await _DoctorIncomeService.DoctorIncomeList(DoctorIncomeInList);

            this.ObjectResultModule.Object     = value;
            this.ObjectResultModule.Message    = "sucess";
            this.ObjectResultModule.StatusCode = 200;
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "DoctorIncomeList",
                OperContent = JsonHelper.ToJson(DoctorIncomeInList),
                OperType    = "DoctorIncomeList",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(this.ObjectResultModule);
        }
Beispiel #4
0
        public async Task <IList <DoctorIncome> > DoctorIncomeList(DoctorIncomeIn DoctorIncomeInfo)
        {
            var DoctorIncomes = await _repository.GetAllListAsync(DoctorIncomeInfo.Expression);

            return(DoctorIncomes.ToList());
        }