Example #1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //          var count = myUserManager.GetUserCount(Active.active);
                //          lblUserCount.Content = "Count: " + count.ToString();
                int userNo   = int.Parse(txtUserID.Text);
                int regionNo = int.Parse(txtRegionID.Text);

                bool updateStatus = myUserRegionManager.EditUserData(userNo, regionNo);
                lblMessage.Content = "User NO: " + userNo + " RegionID: " + regionNo
                                     + "   UpdateStatus: " + updateStatus;

                if (updateStatus == false)
                {
                    lblMessage.Content = "User NO: " + userNo + " is not Updated, try again";
                    txtUserID.Text     = null;
                    txtUserName.Text   = null;
                    txtRegionID.Text   = null;
                }
                else
                {
                    lblMessage.Content = "User NO: " + userNo + "  Updated Succesfully";
                }
            }
            catch (Exception ex)
            {
                //       grdUserList.ItemsSource = null;
                //       lblUserCount.Content = "Count: 0";
                MessageBox.Show("USER..... failure here : " + ex.Message + ex.StackTrace);
                lblMessage.Content = "Reached Exception in User Update... ";
            }
        }
Example #2
0
        public void EditUserDataTest()
        {
            int  userID   = 1000;
            int  regionID = 1;
            bool result   = regionManager.EditUserData(userID, regionID);

            Assert.AreEqual(true, result);
        }