private void btnCreateGroup_Click(object sender, RoutedEventArgs e)
        {
            var groupName = this.txtHomeName.Text;

            if (groupName.Length > 0)
            {
                var value = this.nudCutOffDay.Value;

                var he = new HomeExist(new DbOperations());
                if (!he.CheckName(groupName))
                {
                    var cutoffday = 1;
                    if (value != null)
                    {
                        cutoffday = (int)value;
                    }
                    var adg     = new AddNewGroup(new DbOperations());
                    int groupId = he.GetGroupId(groupName);
                    var result  = adg.Add(
                        new Group {
                        Name       = groupName,
                        CutOffDate = cutoffday,
                        GroupId    = groupId
                    });
                    MessageBox("CREATE GROUP", result ? "SUCCESS" : "ERROR:CREATING GROUP");
                }
                else
                {
                    MessageBox("CREATE GROUP", $"{groupName} IS ALREADY IN USE!");
                }
            }
        }
Beispiel #2
0
 public SelectMemberHandler(AddNewGroup groupform, Account acc)
 {
     this.groupform = groupform;
     this.acc       = acc;
 }