Example #1
0
 // constructor
 public Livestock(CareLevel _careLevel, Temperment _temperment, WaterType _waterType, string _colours, string _waterConditions, string _maxSize, string _name, string _description, double _price) : base(_name, _description, _price)
 {
     CareLevel       = _careLevel;
     Temperment      = _temperment;
     WaterType       = _waterType;
     Colours         = _colours;
     WaterConditions = _waterConditions;
     MaxSize         = _maxSize;
 }
Example #2
0
 /// <summary>
 /// 初始化所有的属性,包括引用类型的属性自己的属性
 /// </summary>
 public override void ReInitializeAllProperties()
 {
     try
     {
         if (AdmitInfo != null)
         {
             AdmitInfo.ReInitializeAllProperties();
         }
         if (DischargeInfo != null)
         {
             DischargeInfo.ReInitializeAllProperties();
         }
         if (AdmissionKind != null)
         {
             AdmissionKind.ReInitializeAllProperties();
         }
         if (AdmitStatus != null)
         {
             AdmitStatus.ReInitializeAllProperties();
         }
         if (DischargeStatus != null)
         {
             DischargeStatus.ReInitializeAllProperties();
         }
         if (DiagnosisOfClinic != null)
         {
             DiagnosisOfClinic.ReInitializeAllProperties();
         }
         if (ClinicDoctor != null)
         {
             ClinicDoctor.ReInitializeAllProperties();
         }
         if (ChineseDiagnosisOfClinic != null)
         {
             ChineseDiagnosisOfClinic.ReInitializeAllProperties();
         }
         if (ChineseDiagnosisOfClinic2 != null)
         {
             ChineseDiagnosisOfClinic2.ReInitializeAllProperties();
         }
         if (Resident != null)
         {
             Resident.ReInitializeAllProperties();
         }
         if (AttendingPhysician != null)
         {
             AttendingPhysician.ReInitializeAllProperties();
         }
         if (Director != null)
         {
             Director.ReInitializeAllProperties();
         }
         if (CareLevel != null)
         {
             CareLevel.ReInitializeAllProperties();
         }
     }
     catch (Exception)
     {
     }
 }
Example #3
0
        public async Task EditAsync(int id, string name, int minTankSize, bool reefCompatible, CareLevel careLevel,
                                    Temperament temperament, int maxSize, string diet, string imageUrl)
        {
            var existingBreed = await this.db
                                .Breeds
                                .FindAsync(id);

            if (existingBreed == null)
            {
                return;
            }

            existingBreed.Name           = name;
            existingBreed.MinTankSize    = minTankSize;
            existingBreed.ReefCompatible = reefCompatible;
            existingBreed.CareLevel      = careLevel;
            existingBreed.Temperament    = temperament;
            existingBreed.MaxSize        = maxSize;
            existingBreed.Diet           = diet;
            existingBreed.ImageUrl       = imageUrl;

            await this.db.SaveChangesAsync();
        }
Example #4
0
        public async Task AddBreedAsync(string name, int minTankSize, bool reefCompatible, CareLevel careLevel,
                                        Temperament temperament, int maxSize, string diet, string imageUrl)
        {
            var breed = new Breed
            {
                Name           = name,
                MinTankSize    = minTankSize,
                ReefCompatible = reefCompatible,
                CareLevel      = careLevel,
                Temperament    = temperament,
                MaxSize        = maxSize,
                Diet           = diet,
                ImageUrl       = imageUrl
            };

            this.db.Add(breed);
            await this.db.SaveChangesAsync();
        }
Example #5
0
 // Constructor
 public CartLivestock(CareLevel _careLevel, Temperment _temperment, WaterType _waterType, string _colours, string _waterConditions, string _maxSize, string _name, string _description, double _price) :
     base(_careLevel, _temperment, _waterType, _colours, _waterConditions, _maxSize, _name, _description, _price)
 {
 }