Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GroupUtilities groupUtilities = new GroupUtilities();

            ShowGroups(groupUtilities.GetGroups());
            if (Request.HttpMethod == "POST")
            {
                string groupName = groupname.Value;
                if (!string.IsNullOrEmpty(groupName))
                {
                    if (!groupUtilities.VerifyGroupExists(groupName))
                    {
                        string result = groupUtilities.InsertGroup(groupName);
                        if (result == "Success")
                        {
                            toastrUtilities.SessionPush("toast", new KeyValuePair <string, string>("success", $"{groupName} Successfully Added."));
                        }
                    }
                    else
                    {
                        toastrUtilities.SessionPush("toast", new KeyValuePair <string, string>("error", $"{groupName} Already Exists!"));
                    }
                }
                else
                {
                    toastrUtilities.SessionPush("toast", new KeyValuePair <string, string>("error", "Please Enter Group Name."));
                }
            }
        }