Exemplo n.º 1
0
        public async Task <IActionResult> DeletePatientMemberAsync(string patientGuid)
        {
            var biz   = new PatientMemberBiz();
            var model = await biz.GetAsync(patientGuid);

            if (model == null || model.UserGuid != UserID)
            {
                return(Failed(ErrorCode.UserData, "未找到就诊人"));
            }
            model.LastUpdatedBy   = UserID;
            model.LastUpdatedDate = DateTime.Now;
            model.Enable          = false;
            var result = await biz.UpdateAsync(model);

            return(result ? Success() : Failed(ErrorCode.DataBaseError, "删除就诊人失败"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> UpdatePatientMemberAsync([FromBody] UpdatePatientRequestDto requestDto)
        {
            var biz   = new PatientMemberBiz();
            var model = await biz.GetAsync(requestDto.PatientGuid);

            if (model == null || model.UserGuid != UserID)
            {
                return(Failed(ErrorCode.UserData, "未找到就诊人"));
            }
            model.CardNo          = requestDto.CardNo;
            model.Name            = requestDto.Name;
            model.Phone           = requestDto.Phone;
            model.Gender          = requestDto.Gender.ToString();
            model.Birthday        = requestDto.Birthday.HasValue ? (DateTime?)requestDto.Birthday.Value : null;
            model.CreatedBy       = UserID;
            model.IsDefault       = requestDto.IsDefault;
            model.LastUpdatedBy   = UserID;
            model.LastUpdatedDate = DateTime.Now;
            model.Relationship    = requestDto.Relationship.HasValue ? requestDto.Relationship.Value.ToString() : null;
            var result = await new PatientMemberBiz().UpdatePatientMemberAsync(UserID, model);

            return(result ? Success() : Failed(ErrorCode.DataBaseError, "修改就诊人失败"));
        }