コード例 #1
0
        /// <summary>
        /// Creator: Awaab Elamin
        /// Created: 2020/02/04
        /// Approver : Mohamed Elamin
        /// after reviewer select a customer record, btnOpenRecord retrireve that customer data and filled
        /// the customer details and hidden the adoption appliaction then show the customer data
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sender"></param>
        private void btnOpenRecord_Click(object sender, RoutedEventArgs e)
        {
            List <Questionnair> questionnairs = new List <Questionnair>();

            try
            {
                adoptionApplication = (AdoptionApplication)DGViewData.SelectedItem;
                if (adoptionApplication != null)
                {
                    this.customerEmail = adoptionApplication.CustomerEmail;
                    reviewerManager    = new ReviewerManager();
                    customer           = reviewerManager.retrieveCustomerByCustomerName(this.customerEmail);

                    List <CustomerQuestionnar> customerQuestionnars = reviewerManager.retrieveCustomerQuestionnar(this.customerEmail);
                    lblCustomerName.Content = adoptionApplication.CustomerEmail;

                    DGViewQuestionnair.ItemsSource = customerQuestionnars;
                    adoptionApplication            = new AdoptionApplication();

                    ReviewerDecission.Visibility        = Visibility.Hidden;
                    ViewAdoptionApplications.Visibility = Visibility.Hidden;
                    CustomerQustionnair.Visibility      = Visibility.Visible;
                }
                else
                {
                    lblAdoptionApplicationErrorMessage.Content = "Please select a customer";
                }
            }
            catch (Exception)
            {
                lblAdoptionApplicationErrorMessage.Content = "This customer did not fill the questionnar!";
            }
        }
コード例 #2
0
        public void TestRetrieveCustomerQuestionnair()
        {
            //arrange
            List <CustomerQuestionnar> customerQuestionnars = new List <CustomerQuestionnar>();
            string customerEmail = "*****@*****.**";

            //acct
            customerQuestionnars = reviewerManager.retrieveCustomerQuestionnar(customerEmail);

            ////Assert
            Assert.AreEqual(10, customerQuestionnars.Count);
        }