Example #1
0
        public async Task <ObjectResultModule> CreateDoctorIncome([FromBody] DoctorIncome input)
        {
            if (!Commons.CheckSecret(input.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 create = new DoctorIncome()
            {
                DoctorName     = input.DoctorName,
                DoctorID       = input.DoctorID,
                IncomeTimeType = input.IncomeTimeType,
                Total          = input.Total,
                CreatedBy      = userid,
                CreatedOn      = DateTime.Now
            };
            var res = await _DoctorIncomeService.CreateDoctorIncome(create);

            if (res.Id > 0)
            {
                this.ObjectResultModule.StatusCode = 200;
                this.ObjectResultModule.Message    = "sucess";
                this.ObjectResultModule.Object     = res;
            }
            else
            {
                this.ObjectResultModule.Object     = "";
                this.ObjectResultModule.StatusCode = 400;
                this.ObjectResultModule.Message    = "error!";
            }
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "CreateDoctorIncome",
                OperContent = JsonHelper.ToJson(input),
                OperType    = "CreateDoctorIncome",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(this.ObjectResultModule);
        }
Example #2
0
        public async Task <ObjectResultModule> UpdateDoctorIncome([FromBody] DoctorIncome input)
        {
            if (!Commons.CheckSecret(input.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 query  = await _DoctorIncomeService.DoctorIncomeByID(input.Id);

            if (query != null)
            {
                query.DoctorName     = input.DoctorName;
                query.DoctorID       = input.DoctorID;
                query.IncomeTimeType = input.IncomeTimeType;
                query.Total          = input.Total;
                query.ModifyOn       = DateTime.Now;
                query.ModifyBy       = userid;
                var res = await _DoctorIncomeService.UpdateDoctorIncome(query);

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

            #endregion

            return(this.ObjectResultModule);
        }
Example #3
0
        public async Task <DoctorIncome> CreateDoctorIncome(DoctorIncome DoctorIncomeInfo)
        {
            DoctorIncomeInfo.Id = await _repository.InsertAndGetIdAsync(DoctorIncomeInfo);

            return(DoctorIncomeInfo);
        }
Example #4
0
 public async Task ToTalDoctorIncome(DoctorIncome DoctorIncomeInfo)
 {
     await _repository.InsertAsync(DoctorIncomeInfo);
 }
Example #5
0
 public async Task <DoctorIncome> DeleteDoctorIncome(DoctorIncome DoctorIncomeInfo)
 {
     return(await _repository.UpdateAsync(DoctorIncomeInfo));
 }