コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        /// <exception>医院不存在</exception>
        public static GetHospitalResponse GetHospital(GetHospitalRequest request)
        {
            var hospital = HospitalRep.GetByID(request.HospitalID).ThrowIfNull("医院不存在");

            return(new GetHospitalResponse()
            {
                CreateUserItem = new ApiTranRequest.CreateUserItem()
                {
                    CreateTime = hospital.CreateTime,
                    CreateUserID = Guid.Empty,
                    Name = ""
                },
                UpdateUserItem = new ApiTranRequest.UpdateUserItem()
                {
                    UpdateUserID = Guid.Empty,
                    Name = "",
                    UpdateTime = hospital.UpdateTime,
                },
                HospitalItem = new ApiTranRequest.Hospital.GetHospital.HospitalItem()
                {
                    HospitalID = hospital.ID,
                    Name = hospital.Name
                }
            });
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <exception>医院不存在</exception>
        public static void UpdateHospital(UpdateHospitalRequest request)
        {
            var hospital = HospitalRep.GetByID(request.HospitalID).ThrowIfNull("医院不存在");

            hospital.Name = request.Name;
            HospitalRep.Update(hospital);
        }
コード例 #3
0
        public static void DeleteHospital(DeleteHospitalRequest request)
        {
            var hospital = HospitalRep.GetByID(request.HospitalID);

            if (hospital != null)
            {
                HospitalRep.Delete(hospital);
            }
        }