Example #1
0
        public List<DogGender> GetDog_Gender()
        {
            List<DogGender> dogGenderList = new List<DogGender>();
            DogGenderBL dogGender = new DogGenderBL();
            lkpDogGender = dogGender.GetDog_Gender();

            if (lkpDogGender != null && lkpDogGender.Count > 0)
            {
                foreach (sss.lkpDog_GenderRow row in lkpDogGender)
                {
                    DogGender gender = new DogGender(row.Dog_Gender_ID);
                    dogGenderList.Add(gender);
                }
            }
            return dogGenderList;
        }
Example #2
0
        public List <DogGender> GetDog_Gender()
        {
            List <DogGender> dogGenderList = new List <DogGender>();
            DogGenderBL      dogGender     = new DogGenderBL(_connString);

            lkpDogGender = dogGender.GetDog_Gender();

            if (lkpDogGender != null && lkpDogGender.Rows.Count > 0)
            {
                foreach (DataRow row in lkpDogGender.Rows)
                {
                    DogGender gender = new DogGender(_connString, Utils.DBNullToInt(row["Dog_Gender_ID"]));
                    dogGenderList.Add(gender);
                }
            }
            return(dogGenderList);
        }
Example #3
0
    private void PopulateSire()
    {
        Guid sire_ID = new Guid(Sire_ID);
        Dogs dog = new Dogs(sire_ID);

        txtSireKCName.Text = dog.Dog_KC_Name;
        txtSirePetName.Text = dog.Dog_Pet_Name;

        if (dog.Dog_Breed_ID != null && dog.Dog_Breed_ID != 1)
        {
            int dog_Breed_ID = Int32.Parse(dog.Dog_Breed_ID.ToString());
            DogBreeds dogBreeds = new DogBreeds(dog_Breed_ID);
            txtSireBreed.Text = dogBreeds.Description;
        }
        if (dog.Dog_Gender_ID != null && dog.Dog_Gender_ID != 1)
        {
            int dog_Gender_ID = Int32.Parse(dog.Dog_Gender_ID.ToString());
            DogGender dogGender = new DogGender(dog_Gender_ID);
            txtSireGender.Text = dogGender.Description;
        }
        divGetSire.Visible = false;
        divChangeSire.Visible = true;
        divSireDetails.Visible = true;
    }
Example #4
0
    private void PopulateDog()
    {
        Guid current_dog_ID = new Guid(Current_Dog_ID);
        Dogs dog = new Dogs(current_dog_ID);

        txtKCName.Text = dog.Dog_KC_Name;
        txtPetName.Text = dog.Dog_Pet_Name;
        lblNLWU.Text = string.Format("Tick this box if {0} is no longer with us.", dog.Dog_Pet_Name);

        if (dog.Dog_Breed_ID != null)
        {
            int dog_Breed_ID = Int32.Parse(dog.Dog_Breed_ID.ToString());
            DogBreeds dogBreeds = new DogBreeds(dog_Breed_ID);
            txtDogBreed.Text = dogBreeds.Description;
        }
        if (dog.Dog_Gender_ID != null)
        {
            int dog_Gender_ID = Int32.Parse(dog.Dog_Gender_ID.ToString());
            DogGender dogGender = new DogGender(dog_Gender_ID);
            txtDogGender.Text = dogGender.Description;
        }
        if (dog.Reg_No != null)
        {
            Reg_No = dog.Reg_No.ToString();
            Common.Reg_No = Reg_No;
            txtRegNo.Text = Reg_No;
        }
        if (dog.Date_Of_Birth != null)
        {
            string format = "yyyy-MM-dd";
            Date_Of_Birth = DateTime.Parse(dog.Date_Of_Birth.ToString()).ToString(format);
            Common.Date_Of_Birth = Date_Of_Birth;
            txtDogDOB.Text = Date_Of_Birth;
        }
        if (dog.Merit_Points != null)
        {
            Merit_Points = dog.Merit_Points.ToString();
            Common.Merit_Points = Merit_Points;
            txtMeritPoints.Text = Merit_Points;
        }
        else
        {
            Merit_Points = "0";
            Common.Merit_Points = Merit_Points;
            txtMeritPoints.Text = Merit_Points;
        }
        if (dog.NLWU != null)
        {
            NLWU = (bool)dog.NLWU;
            Common.NLWU = NLWU;
            chkNLWU.Checked = NLWU;
        }
        DogDams dogDams = new DogDams();
        List<DogDams> lnkDogDams;
        lnkDogDams = dogDams.GetDogDamsByDog_ID(dog.Dog_ID);
        if (lnkDogDams.Count != 0)
        {
            Dam_ID = lnkDogDams[0].Dam_ID.ToString();
            Common.Dam_ID = Dam_ID;
            PopulateDam();
        }
        DogSires dogSires = new DogSires();
        List<DogSires> lnkDogSires;
        lnkDogSires = dogSires.GetDogSiresByDog_ID(dog.Dog_ID);
        if (lnkDogSires.Count != 0)
        {
            Sire_ID = lnkDogSires[0].Sire_ID.ToString();
            Common.Sire_ID = Sire_ID;
            PopulateSire();
        }
    }
Example #5
0
    private void PopulateDam()
    {
        Guid dam_ID = new Guid(Dam_ID);
        Dogs dog = new Dogs(dam_ID);

        txtDamKCName.Text = dog.Dog_KC_Name;
        txtDamPetName.Text = dog.Dog_Pet_Name;

        if (dog.Dog_Breed_ID != null && dog.Dog_Breed_ID != 1)
        {
            int dog_Breed_ID = Int32.Parse(dog.Dog_Breed_ID.ToString());
            DogBreeds dogBreeds = new DogBreeds(dog_Breed_ID);
            txtDamBreed.Text = dogBreeds.Description;
        }
        if (dog.Dog_Gender_ID != null && dog.Dog_Gender_ID != 1)
        {
            int dog_Gender_ID = Int32.Parse(dog.Dog_Gender_ID.ToString());
            DogGender dogGender = new DogGender(dog_Gender_ID);
            txtDamGender.Text = dogGender.Description;
        }
        divGetDam.Visible = false;
        divChangeDam.Visible = true;
        divDamDetails.Visible = true;
    }
Example #6
0
 private void PopulateGenderList()
 {
     DogGender dogGender = new DogGender();
     List<DogGender> lkpDog_Gender = dogGender.GetDog_Gender();
     lstGender.DataSource = lkpDog_Gender;
     lstGender.DataBind();
 }
Example #7
0
    private void PopulateDogGridView(List<Dogs> tblDogs, int pageNo)
    {
        if (tblDogs == null)
        {
            tblDogs = Common.Dog_GridViewData;
        }
        List<Dogs> newDogs = new List<Dogs>();

        int itemsperPage = Int32.Parse(WebConfigurationManager.AppSettings["GridItemsPerPage"]);
        int startRowIndex = (pageNo -1) * itemsperPage;
        int currentIndex = 0;
        int itemsRead = 0;
        int totalRecords = tblDogs.Count;
        foreach (Dogs row in tblDogs)
        {
            if (itemsRead < itemsperPage && currentIndex < totalRecords && currentIndex >= startRowIndex)
            {
                Dogs newDog = new Dogs();
                newDog.Dog_ID = row.Dog_ID;
                newDog.Dog_KC_Name = row.Dog_KC_Name;
                newDog.Dog_Pet_Name = row.Dog_Pet_Name;
                if (!row.IsReg_NoNull)
                    newDog.Reg_No = row.Reg_No;
                DogBreeds dogBreeds = new DogBreeds(Convert.ToInt32(row.Dog_Breed_ID));
                newDog.Dog_Breed_Description = dogBreeds.Description;
                DogGender dogGender = new DogGender(Convert.ToInt32(row.Dog_Gender_ID));
                newDog.Dog_Gender = dogGender.Description;
                newDogs.Add(newDog);
                itemsRead++;
            }
            currentIndex++;
        }
        lblTotalPages.Text = CalculateTotalPages(totalRecords).ToString();

        lblCurrentPage.Text = CurrentPage.ToString();

        if (CurrentPage == 1)
        {
            Btn_Previous.Enabled = false;

            if (Int32.Parse(lblTotalPages.Text) > 0)
            {
                Btn_Next.Enabled = true;
            }
            else
                Btn_Next.Enabled = false;

        }

        else
        {
            Btn_Previous.Enabled = true;

            if (CurrentPage == Int32.Parse(lblTotalPages.Text))
                Btn_Next.Enabled = false;
            else Btn_Next.Enabled = true;
        }
        DogGridView.DataSource = newDogs;
        DogGridView.DataBind();
    }
    private bool IsCorrectClassGender(Dogs dog)
    {
        bool correctGender = false;
        ShowEntryClasses sec = new ShowEntryClasses(new Guid(Show_Entry_Class_ID));
        DogGender dg = new DogGender((int)dog.Dog_Gender_ID);
        switch (dg.Description)
        {
            case "Dog":
                if (sec.Class_Gender == Constants.CLASS_GENDER_DB || sec.Class_Gender == Constants.CLASS_GENDER_D)
                    correctGender = true;
                break;
            case "Bitch":
                if (sec.Class_Gender == Constants.CLASS_GENDER_DB || sec.Class_Gender == Constants.CLASS_GENDER_B)
                    correctGender = true;
                break;
            default:
                break;
        }

        return correctGender;
    }