Exemple #1
0
        public async Task <ObjectResultModule> LableClinicList([FromBody] LableManageIn LableManageInfo)
        {
            if (!Commons.CheckSecret(LableManageInfo.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 LableManagemanage = new LabelClinicManageIn()
            {
                ClinicID = LableManageInfo.ClinicID
            };
            var values = await _lableManageService.LableClinicManageInList(LableManagemanage);

            if (values.Count == 0)
            {
                this.ObjectResultModule.Object     = "";
                this.ObjectResultModule.StatusCode = 204;
                this.ObjectResultModule.Message    = "NoContent";
            }
            else
            {
                this.ObjectResultModule.Object     = values;
                this.ObjectResultModule.StatusCode = 200;
                this.ObjectResultModule.Message    = "success";
            }
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "LableClinicList",
                OperContent = JsonHelper.ToJson(LableManageInfo),
                OperType    = "LableClinicList",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(ObjectResultModule);
        }
        public async Task <IList <LabelClinicManage> > LableClinicManageInList(LabelClinicManageIn input)
        {
            var relation  = _relrepository.GetAll();
            var label     = _repository.GetAll();
            var querylist = from a in relation
                            join b in label on a.LableID equals b.Id
                            where !a.IsDelete && !b.IsDelete && a.ClinicID == input.ClinicID
                            select new LabelClinicManage
            {
                CreatedOn   = b.CreatedOn,
                CreatedBy   = b.CreatedBy,
                ModifyBy    = b.ModifyBy,
                ModifyOn    = b.ModifyOn,
                LableName   = b.LableName,
                LableRemark = b.LableRemark,
                ClinicID    = a.ClinicID,
                OrderSort   = b.OrderSort,
            };

            return(await querylist.OrderBy(t => t.OrderSort).ThenByDescending(t => t.CreatedOn).ToListAsync());
        }