コード例 #1
0
        /// <summary>
        /// Creator: Awaab Elamin
        /// Created:  2020/04/15
        /// Approver: Mohamed Elamin
        ///
        /// Get all Animals
        /// <remarks>
        /// Updater:
        /// Updated:
        /// Update:
        /// </remarks>
        /// <return>Animals Medicals Records</return>
        public List <AnimalMedical> getAllAnimals()
        {
            List <AnimalMedical> animals = new List <AnimalMedical>();
            var    conn    = DBConnection.GetConnection();
            string cmdText = @"sp_get__all_animals_medical_Record";
            var    cmd     = new SqlCommand(cmdText, conn);

            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        AnimalMedical animal = new AnimalMedical();
                        animal.AnimalMedicalInfoID       = reader.GetInt32(0);
                        animal.AnimalName                = reader.GetString(1);
                        animal.SpayedNeutered            = reader.GetBoolean(2);
                        animal.Vaccinations              = reader.GetString(3);
                        animal.MostRecentVaccinationDate = reader.GetDateTime(4);
                        animal.AdditionalNotes           = reader.GetString(5);
                        animal.UserFirstName             = reader.GetString(6);
                        animal.UseLastrName              = reader.GetString(7);

                        animals.Add(animal);
                    }
                }
                reader.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
            return(animals);
        }
コード例 #2
0
        /// <summary>
        /// Creator: Awaab Elamin
        /// Created: 2020/2/5
        /// Approver: Mohamed Elamin
        /// default constructor intialays the private lists to work as fake data base
        /// </summary>
        /// <remarks>
        /// Updater Awaab Elamin
        /// Updated: 2020/02/15
        /// Update: (Add General questions list values)
        /// </remarks>
        /// /// <remarks>
        /// Updater Awaab Elamin
        /// Updated: 2020/04/15
        /// Update: (Add Animal Medicals list values)
        /// </remarks>
        public FakeReviewerAccessor()
        {
            adoptionApplications = new List <AdoptionApplication>()
            {
                new AdoptionApplication()
                {
                    AdoptionApplicationID = 10000,
                    CustomerEmail         = "*****@*****.**",
                    AnimalName            = "Bebe",
                    Status       = "Reviewer",
                    RecievedDate = DateTime.Now.Date
                },

                new AdoptionApplication()
                {
                    AdoptionApplicationID = 10001,
                    CustomerEmail         = "*****@*****.**",
                    AnimalName            = "Bebe",
                    Status       = "Reviewer",
                    RecievedDate = DateTime.Now.Date
                },

                new AdoptionApplication()
                {
                    AdoptionApplicationID = 10002,
                    CustomerEmail         = "*****@*****.**",
                    AnimalName            = "Bebe",
                    Status       = "Reviewer",
                    RecievedDate = DateTime.Now.Date
                },

                new AdoptionApplication()
                {
                    AdoptionApplicationID = 10003,
                    CustomerEmail         = "*****@*****.**",
                    AnimalName            = "Bebe",
                    Status       = "Reviewer",
                    RecievedDate = DateTime.Now.Date
                }
            };

            customers = new List <AdoptionCustomer>()
            {
                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "Awaab",
                    LastName       = "Elamin",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                },

                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "Addallah",
                    LastName       = "Ali",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                },

                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "AbelSamee",
                    LastName       = "Tomsah",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                },

                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "Adam",
                    LastName       = "Saleem",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                },

                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "Steph",
                    LastName       = "Wiliam",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                },

                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "Kamal",
                    LastName       = "AlAraby",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                },

                new AdoptionCustomer()
                {
                    CustomerEmail  = "*****@*****.**",
                    FirstName      = "Ali",
                    LastName       = "Taha",
                    PhoneNumber    = "3192104964",
                    AddressLineOne = "3000 J St SW",
                    AddressLineTwo = "Apt 105",
                    City           = "Cedar Rapids",
                    State          = "IA",
                    Zipcode        = "52404",
                    Active         = true
                }
            };

            customerQuestionnars = new List <CustomerQuestionnar>()
            {
                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q1",
                    Answer = "Answer1"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q2",
                    Answer = "Answer2"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q3",
                    Answer = "Answer3"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q4",
                    Answer = "Answer4"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q5",
                    Answer = "Answer5"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q6",
                    Answer = "Answer6"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q7",
                    Answer = "Answer7"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q8",
                    Answer = "Answer8"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q9",
                    Answer = "Answer9"
                },

                new CustomerQuestionnar()
                {
                    QuestionDescription = "Q10",
                    Answer = "Answer10"
                }
            };

            generalQuestions = new List <GeneralQuestion>()
            {
                new GeneralQuestion()
                {
                    QuestionID  = 10000,
                    Description = "Question1"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10001,
                    Description = "Question2"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10002,
                    Description = "Question3"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10003,
                    Description = "Question4"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10004,
                    Description = "Question5"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10005,
                    Description = "Question6"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10006,
                    Description = "Question7"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10007,
                    Description = "Question8"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10008,
                    Description = "Question9"
                },

                new GeneralQuestion()
                {
                    QuestionID  = 10009,
                    Description = "Question10"
                }
            };

            animals                          = new List <AnimalMedical>();
            animal                           = new AnimalMedical();
            animal.AnimalName                = "Animal";
            animal.UserFirstName             = "UserFirstName";
            animal.UseLastrName              = "UserLastName";
            animal.SpayedNeutered            = true;
            animal.Vaccinations              = "V1";
            animal.MostRecentVaccinationDate = DateTime.Now;
            animal.AdditionalNotes           = "Note1";
            animals.Add(animal);


            animal                           = new AnimalMedical();
            animal.AnimalName                = "Animal";
            animal.UserFirstName             = "UserFirstName";
            animal.UseLastrName              = "UserLastName";
            animal.SpayedNeutered            = true;
            animal.Vaccinations              = "V2";
            animal.MostRecentVaccinationDate = DateTime.Now;
            animal.AdditionalNotes           = "Note2";
            animals.Add(animal);


            animal                           = new AnimalMedical();
            animal.AnimalName                = "Animal";
            animal.UserFirstName             = "UserFirstName";
            animal.UseLastrName              = "UserLastName";
            animal.SpayedNeutered            = true;
            animal.Vaccinations              = "V3";
            animal.MostRecentVaccinationDate = DateTime.Now;
            animal.AdditionalNotes           = "Note3";
            animals.Add(animal);


            animal                           = new AnimalMedical();
            animal.AnimalName                = "Animal";
            animal.UserFirstName             = "UserFirstName";
            animal.UseLastrName              = "UserLastName";
            animal.SpayedNeutered            = true;
            animal.Vaccinations              = "V4";
            animal.MostRecentVaccinationDate = DateTime.Now;
            animal.AdditionalNotes           = "Note4";
            animals.Add(animal);


            animal                           = new AnimalMedical();
            animal.AnimalName                = "Animal";
            animal.UserFirstName             = "UserFirstName";
            animal.UseLastrName              = "UserLastName";
            animal.SpayedNeutered            = true;
            animal.Vaccinations              = "V5";
            animal.MostRecentVaccinationDate = DateTime.Now;
            animal.AdditionalNotes           = "Note5";
            animals.Add(animal);
        }