Example #1
0
        public void GetAndDisplayUserRecordTest()
        {
            User user   = null;
            int  userID = 1000;

            user = regionManager.GetAndDisplayUserRecord(userID);
            Assert.IsNotNull(user);
        }
Example #2
0
        private void populateUser()
        {
            try
            {
                lblMessage.Foreground = Brushes.Black;
                lblMessage.Content    = "";

                int userNo = int.Parse(txtUserID.Text);

                User users = (User)myUserRegionManager.GetAndDisplayUserRecord(userNo);

                if (users == null)
                {
                    lblMessage.Foreground = Brushes.Red;
                    lblMessage.Content    = "Users NO: " + userNo + "  Not Found in DataBase, try again";
                    txtUserID.Text        = null;
                    txtUserName.Text      = null;
                    txtRegionID.Text      = null;
                }
                else
                {
                    txtUserName.Text = users.UserName;
                    if (users.RegionId == -1)
                    {
                        txtRegionID.Text = "";
                    }
                    else
                    {
                        txtRegionID.Text = users.RegionId.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                //       grdUserList.ItemsSource = null;
                //       lblUserCount.Content = "Count: 0";
                MessageBox.Show("USER..... failure here : " + ex.Message + ex.StackTrace);
            }
        }