private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         wpfPositionInfo frm = new wpfPositionInfo();
         frm.status = "Add";
         frm.UserID = UserID;
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         return;
     }
 }
 private void btnView_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int n = Convert.ToInt32(getRow(dgBank, 0));
         if (n == 1)
         {
             MessageBox.Show("Unable to process", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
             return;
         }
         wpfPositionInfo frm = new wpfPositionInfo();
         frm.status = "View";
         frm.UserID = UserID;
         frm.pID = n;
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         return;
     }
 }