Exemple #1
0
        public List <Dogs> GetDogsByDog_Breed_ID(List <DogBreeds> lkpDogBreeds)
        {
            List <Dogs> retVal = new List <Dogs>();

            string dog_Breed_IDs = null;

            foreach (DogBreeds dog_Breed in lkpDogBreeds)
            {
                dog_Breed_IDs += dog_Breed.Dog_Breed_ID + ", ";
            }
            string Breed_IDs = dog_Breed_IDs.Substring(0, dog_Breed_IDs.Length - 2);


            try
            {
                DogsBL dogs = new DogsBL(_connString);
                tblDogs = dogs.GetDogsWhereBreed_IDInList(Breed_IDs);

                if (tblDogs != null && tblDogs.Rows.Count > 0)
                {
                    foreach (DataRow row in tblDogs.Rows)
                    {
                        Dogs dog = new Dogs(_connString, Utils.DBNullToGuid(row["Dog_ID"]));
                        retVal.Add(dog);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemple #2
0
        public Dogs(string connString, Guid dog_ID)
        {
            _connString = connString;

            try
            {
                DogsBL dogs = new DogsBL(_connString);
                tblDogs = dogs.GetDogsByDog_ID(dog_ID);
                DataRow row = tblDogs.Rows[0];

                _dog_ID        = dog_ID;
                _dog_KC_Name   = Utils.DBNullToString(row["Dog_KC_Name"]);
                _dog_Pet_Name  = Utils.DBNullToString(row["Dog_Pet_Name"]);
                _dog_Breed_ID  = Utils.DBNullToInt(row["Dog_Breed_ID"]);
                _dog_Gender_ID = Utils.DBNullToInt(row["Dog_Gender_ID"]);
                _reg_No        = Utils.DBNullToString(row["Reg_No"]);
                _date_Of_Birth = Utils.DBNullToDate(row["Date_Of_Birth"]);
                _year_Of_Birth = Utils.DBNullToShort(row["Year_Of_Birth"]);
                _merit_Points  = Utils.DBNullToShort(row["Merit_Points"]);
                _nLWU          = Utils.DBNullToBool(row["NLWU"]);
                _breeder       = Utils.DBNullToString(row["Breeder"]);
                _sire          = Utils.DBNullToString(row["Sire"]);
                _dam           = Utils.DBNullToString(row["Dam"]);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public List <Dogs> GetDogByRegNo(string reg_No)
        {
            List <Dogs> retVal = new List <Dogs>();

            try
            {
                DogsBL dogs = new DogsBL(_connString);
                tblDogs = dogs.GetDogByRegNo(reg_No);

                if (tblDogs != null && tblDogs.Rows.Count > 0)
                {
                    foreach (DataRow row in tblDogs.Rows)
                    {
                        Dogs dog = new Dogs(_connString, Utils.DBNullToGuid(row["Dog_ID"]));
                        retVal.Add(dog);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemple #4
0
        public int GetMaxNAFNo()
        {
            int retVal = -1;

            try
            {
                DogsBL dogs = new DogsBL(_connString);
                retVal = dogs.GetMaxNAFNo();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemple #5
0
        public bool Update_Dog(Guid dog_ID, Guid user_ID)
        {
            bool retVal = false;

            try
            {
                DogsBL dogs = new DogsBL(_connString);
                retVal = dogs.Update_Dogs(dog_ID, _dog_KC_Name, _dog_Pet_Name, _dog_Breed_ID, _dog_Gender_ID,
                                          _reg_No, _date_Of_Birth, _year_Of_Birth, _merit_Points, _nLWU, _breeder, _sire, _dam, _deleteDog, user_ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemple #6
0
        public Guid?Insert_Dog(Guid user_ID)
        {
            Guid?retVal = null;

            try
            {
                DogsBL dogs = new DogsBL(_connString);
                retVal = dogs.Insert_Dogs(_dog_KC_Name, _dog_Pet_Name, _dog_Breed_ID, _dog_Gender_ID,
                                          _reg_No, _date_Of_Birth, _year_Of_Birth, _merit_Points, _nLWU, _breeder, _sire, _dam, user_ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemple #7
0
        public bool Update_Dog(Guid dog_ID, Guid user_ID)
        {
            bool success = false;

            DogsBL dogs = new DogsBL();
            success = dogs.Update_Dogs(dog_ID, Dog_KC_Name, Dog_Pet_Name, Dog_Breed_ID, Dog_Gender_ID,
                Reg_No, Date_Of_Birth, Year_Of_Birth, Merit_Points, NLWU, DeleteDog, user_ID);

            return success;
        }
Exemple #8
0
        public Guid? Insert_Dog(Guid user_ID)
        {
            DogsBL dogs = new DogsBL();
            Guid? newID = (Guid?)dogs.Insert_Dogs(Dog_KC_Name, Dog_Pet_Name, Dog_Breed_ID, Dog_Gender_ID,
                Reg_No, Date_Of_Birth, Year_Of_Birth, Merit_Points, NLWU, user_ID);

            return newID;
        }
Exemple #9
0
        public List<Dogs> GetDogsLikeDog_Pet_Name(string dog_Pet_Name)
        {
            List<Dogs> dogList = new List<Dogs>();
            DogsBL dogs = new DogsBL();
            tblDogs = dogs.GetDogsLikeDog_Pet_Name(dog_Pet_Name);

            if (tblDogs != null && tblDogs.Count > 0)
            {
                foreach (sss.tblDogsRow row in tblDogs)
                {
                    Dogs dog = new Dogs(row.Dog_ID);
                    dogList.Add(dog);
                }
            }
            return dogList;
        }
Exemple #10
0
        public List<Dogs> GetDogsByDog_Breed_ID(List<DogBreeds> lkpDogBreeds)
        {
            string dog_Breed_IDs = null;
            foreach (DogBreeds dog_Breed in lkpDogBreeds)
            {
                dog_Breed_IDs += dog_Breed.Dog_Breed_ID + ", ";
            }
            string Breed_IDs = dog_Breed_IDs.Substring(0, dog_Breed_IDs.Length - 2);

            List<Dogs> dogList = new List<Dogs>();
            DogsBL dogs = new DogsBL();
            tblDogs = dogs.GetDogsWhereBreed_IDInList(Breed_IDs);

            if (tblDogs != null && tblDogs.Count > 0)
            {
                foreach (sss.tblDogsRow row in tblDogs)
                {
                    Dogs dog = new Dogs(row.Dog_ID);
                    dogList.Add(dog);
                }
            }
            return dogList;
        }
Exemple #11
0
        public Dogs(Guid dog_ID)
        {
            DogsBL dogs = new DogsBL();
            tblDogs = dogs.GetDogsByDog_ID(dog_ID);

            Dog_ID = dog_ID;
            IsDog_KC_NameNull=tblDogs[0].IsDog_KC_NameNull();
            if (!IsDog_KC_NameNull)
                Dog_KC_Name = tblDogs[0].Dog_KC_Name;
            IsDog_Pet_NameNull=tblDogs[0].IsDog_Pet_NameNull();
            if (!IsDog_Pet_NameNull)
                Dog_Pet_Name = tblDogs[0].Dog_Pet_Name;
            IsDog_Breed_IDNull = tblDogs[0].IsDog_Breed_IDNull();
            if (!IsDog_Breed_IDNull)
                Dog_Breed_ID = tblDogs[0].Dog_Breed_ID;
            IsDog_Gender_IDNull = tblDogs[0].IsDog_Gender_IDNull();
            if (!IsDog_Gender_IDNull)
                Dog_Gender_ID = tblDogs[0].Dog_Gender_ID;
            IsReg_NoNull = tblDogs[0].IsReg_NoNull();
            if (!IsReg_NoNull)
                Reg_No = tblDogs[0].Reg_No;
            IsDate_Of_BirthNull = tblDogs[0].IsDate_Of_BirthNull();
            if (!IsDate_Of_BirthNull)
                Date_Of_Birth = tblDogs[0].Date_Of_Birth;
            IsYear_Of_BirthNull = tblDogs[0].IsYear_Of_BirthNull();
            if (!IsYear_Of_BirthNull)
                Year_Of_Birth = tblDogs[0].Year_Of_Birth;
            IsMerit_PointsNull = tblDogs[0].IsMerit_PointsNull();
            if (!IsMerit_PointsNull)
                Merit_Points = tblDogs[0].Merit_Points;
            IsNLWUNull = tblDogs[0].IsNLWUNull();
            if (!IsNLWUNull)
                NLWU = tblDogs[0].NLWU;
        }