/// <summary> /// /// </summary> /// <param name="scheduling"></param> public DoctorSchedulingOutDetail(DoctorScheduling scheduling) { DoctorName = scheduling.DoctorName; DoctorID = scheduling.DoctorID; DoctorJSON = scheduling.DoctorJSON; SchedulingDate = scheduling.SchedulingDate; SchedulingTime = scheduling.SchedulingTime; Duplication = scheduling.Duplication; ClinicType = scheduling.ClinicType; ClinicIDAdd = scheduling.ClinicIDAdd; RegistrationFee = scheduling.RegistrationFee; ServiceState = scheduling.ServiceState; CreatedBy = scheduling.CreatedBy; Id = scheduling.Id; SchedulingDateUtc = scheduling.SchedulingDate.ToString("yyyy-MM-dd"); }
/// <summary> /// /// </summary> /// <param name="scheduling"></param> public DoctorSchedulingOutList(DoctorScheduling scheduling) { DoctorName = scheduling.DoctorName; DoctorID = scheduling.DoctorID; DoctorJSON = scheduling.DoctorJSON; SchedulingDate = scheduling.SchedulingDate; SchedulingTime = scheduling.SchedulingTime; Duplication = JsonHelper.FromJson <CodeList>(scheduling.Duplication).Value; ClinicType = JsonHelper.FromJson <CodeList>(scheduling.ClinicType).Value; ClinicIDAdd = scheduling.ClinicIDAdd; RegistrationFee = scheduling.RegistrationFee; ServiceState = scheduling.ServiceState; CreatedBy = scheduling.CreatedBy; CreatedOn = scheduling.CreatedOn; Id = scheduling.Id; SchedulingDateUtc = scheduling.SchedulingDate.ToString("yyyy-MM-dd"); }
public async Task <ObjectResultModule> DeleteDoctorScheduling([FromBody] DoctorScheduling 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 _DoctorSchedulingService.DoctorSchedulingByID(input.Id); if (query != null) { query.DeleteBy = userid; query.DeleteTime = DateTime.Now; query.IsDelete = true; var res = await _DoctorSchedulingService.DeleteDoctorScheduling(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 = "DeleteDoctorScheduling", OperContent = JsonHelper.ToJson(input), OperType = "DeleteDoctorScheduling", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }
public async Task <ObjectResultModule> CreateDoctorScheduling([FromBody] DoctorSchedulingInAdd 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 doctor = await _YaeherDoctorService.YaeherDoctorByUserID(userid); if (doctor == null) { this.ObjectResultModule.StatusCode = 100; this.ObjectResultModule.Message = "该角色不是医生账号,不可排班!"; this.ObjectResultModule.Object = ""; } var param = new SystemParameterIn() { Type = "ConfigPar" }; param.AndAlso(t => !t.IsDelete && t.SystemCode == "DoctorSchedulingTime"); var paramlist = await _systemParameterService.ParameterList(param); var timelist = new List <CodeList>(); foreach (var item in input.SchedulingTimeList) { var codelist = paramlist.Find(t => t.Code == item.Code); var newcode = new CodeList() { Code = codelist.Code, Value = codelist.Name, Type = codelist.SystemType, TypeCode = codelist.SystemCode }; timelist.Add(newcode); } param = new SystemParameterIn() { Type = "ConfigPar" }; param.AndAlso(t => !t.IsDelete && t.SystemCode == "DoctorSchedulingType"); var typelist = await _systemParameterService.ParameterList(param); var type = typelist.Find(t => t.Code == input.Duplication); var typecode = new CodeList() { Code = type.Code, Value = type.Name, Type = type.SystemType, TypeCode = type.SystemCode }; param = new SystemParameterIn() { Type = "ConfigPar" }; param.AndAlso(t => !t.IsDelete && t.SystemCode == "DoctorSchedulingState"); var statelist = await _systemParameterService.ParameterList(param); var state = statelist.Find(t => t.Code == input.ClinicType); var statecode = new CodeList() { Code = state.Code, Value = state.Name, Type = state.SystemType, TypeCode = state.SystemCode }; var create = new DoctorScheduling() { DoctorName = doctor.DoctorName, DoctorID = doctor.Id, DoctorJSON = JsonHelper.ToJson(doctor), SchedulingDate = input.SchedulingDate, SchedulingTime = JsonHelper.ToJson(timelist), Duplication = JsonHelper.ToJson(typecode), ClinicType = JsonHelper.ToJson(statecode), ClinicIDAdd = input.ClinicIDAdd, RegistrationFee = input.RegistrationFee, ServiceState = input.ServiceState, CreatedBy = userid, CreatedOn = DateTime.Now }; var res = await _DoctorSchedulingService.CreateDoctorScheduling(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 = "CreateDoctorScheduling", OperContent = JsonHelper.ToJson(input), OperType = "CreateDoctorScheduling", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }
public async Task <DoctorScheduling> UpdateDoctorScheduling(DoctorScheduling DoctorSchedulingInfo) { return(await _repository.UpdateAsync(DoctorSchedulingInfo)); }
public async Task <DoctorScheduling> CreateDoctorScheduling(DoctorScheduling DoctorSchedulingInfo) { DoctorSchedulingInfo.Id = await _repository.InsertAndGetIdAsync(DoctorSchedulingInfo); return(DoctorSchedulingInfo); }