예제 #1
0
 /// <summary>
 /// Check exist group id
 /// </summary>
 private void txtID_Leave(object sender, EventArgs e)
 {
     try
     {
         if (mode == "A")
         {
             GroupUser g = GroupUser.LoadGroupUserById(txtID.Text);
             if (g != null)
             {
                 lblTestID.Text      = "Duplicate";
                 lblTestID.ForeColor = Color.Red;
                 btnApply.Enabled    = false;
                 txtID.Focus();
             }
             else
             {
                 lblTestID.Text      = "OK";
                 lblTestID.ForeColor = Color.Green;
                 btnApply.Enabled    = true;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
예제 #2
0
 /// <summary>
 /// Show group user info in controls
 /// </summary>
 private void GetGroupUser()
 {
     try
     {
         GroupUser g = GroupUser.LoadGroupUserById(groupId);
         if (g != null)
         {
             txtID.Text   = g.groupId;
             txtName.Text = g.groupName;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }