예제 #1
0
 public void addGroup(string groupName)  //add group method utilized by the new group popup
 {
     try
     {
         _groupController.CreateGroup(groupName, UniversalConstants.CountSize);
         fillGroupComboBox();
         groupComboBox.SelectedIndex = groupComboBox.FindStringExact(groupName);
         updateListViews();
     }
     catch
     {
         if (_textController.GetTextByName(groupName) != null)
         {
             string errorMessage = "You cannot name a group the same name as one of the saved texts";
             var    form2        = new ErrorMessageDisplay(errorMessage);
             form2.Show(this);
         }
         else if (_groupController.GetGroupByName(groupName) != null)
         {
             string errorMessage = "You have already created that group";
             var    form2        = new ErrorMessageDisplay(errorMessage);
             form2.Show(this);
         }
         else
         {
             string errorMessage = "You must not leave the group name blank";
             var    form2        = new ErrorMessageDisplay(errorMessage);
             form2.Show(this);
         }
     }
 }
예제 #2
0
 public bool CreateGroup(string name, int profileId)
 {
     return(groupController.CreateGroup(name, profileId));
 }