コード例 #1
0
        public override T Convert <T, U>(U entity)
        {
            List <PatientType> patientType = entity as List <PatientType>;

            if (patientType == null)
            {
                return(default(T));
            }

            List <BO.Common.PatientType> boPatientType = new List <BO.Common.PatientType>();

            foreach (var eachPatientType in patientType)
            {
                BO.Common.PatientType boPatType = new BO.Common.PatientType();

                boPatType.ID = eachPatientType.Id;
                boPatType.PatientTypeText = eachPatientType.PatientTypeText;
                boPatType.IsDeleted       = eachPatientType.IsDeleted;

                boPatientType.Add(boPatType);
            }


            return((T)(object)boPatientType);
        }
コード例 #2
0
        public override object Get(int id)
        {
            var acc = _context.PatientTypes.Where(p => p.Id == id && (p.IsDeleted.HasValue == false || p.IsDeleted == false)).FirstOrDefault <PatientType>();

            if (acc == null)
            {
                return(new BO.ErrorObject {
                    ErrorMessage = "No record found.", errorObject = "", ErrorLevel = ErrorLevel.Error
                });
            }

            BO.Common.PatientType acc_ = ObjectConvert <BO.Common.PatientType, PatientType>(acc);

            return((object)acc_);
        }
コード例 #3
0
        public override T ObjectConvert <T, U>(U entity)
        {
            PatientType patientType = entity as PatientType;

            if (patientType == null)
            {
                return(default(T));
            }

            BO.Common.PatientType boPatType = new BO.Common.PatientType();

            boPatType.ID = patientType.Id;
            boPatType.PatientTypeText = patientType.PatientTypeText;
            boPatType.IsDeleted       = patientType.IsDeleted;

            return((T)(object)boPatType);
        }