private void 添加分组ToolStripMenuItem_Click(object sender, EventArgs e) { AddGroupForm af = new AddGroupForm(); af.ShowDialog(); if (af.IsOk) { if (Group_Users.ContainsKey(af.groupname)) { MessageBox.Show("已存在该分组!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } JObject param = new JObject(); param.Add("id", GlobalClass.CurrentUser.Id); param.Add("groupname", af.groupname); string result = HTTPUtil.SendPostRequest(Util.GetHttpUrl() + "/addgroup", param.ToString()); if (result == "添加成功!") { friendsTree.Nodes.Add(af.groupname); Group_Users.Add(af.groupname, new List <User>()); GlobalClass.Groups.Add(af.groupname); } else { MessageBox.Show(result, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void button1_Click(object sender, EventArgs e) { Form addform = new AddGroupForm(); this.AddOwnedForm(addform); addform.ShowDialog(); }
public async Task <dynamic> AddGroup(AddGroupForm obj) { var(isRegistered, id) = await _group.Add( new Group { CuratorId = obj.CuratorId, DepartmentId = obj.Id, EduFrom = obj.EduFrom, EduLevel = obj.EduLevel, HeadManId = 0, Key = obj.Name, Notes = obj.Note, StudyForm = obj.StudyForm, Speciality = obj.Speciality } ); if (isRegistered) { return(LocalRedirect("/Group/desc/" + id)); } else { return("Непредвиденная ошибка : вызванная скорее всего тем что группа уже существует или тем что вы некоректно ввели данные"); } }
private void addGroupBtn_Click(object sender, EventArgs e) { UnsavedData = true; AddGroupForm agf = new AddGroupForm(); agf.ShowDialog(); LoadGroups(); }
public IWebElement GetAddGroup(AdGroupModel data) { this.OpenAdGroupPanel(); IWebElement AdGroup; IList <IWebElement> AddGroupList = AddGroupForm.FindElements(By.ClassName("box")); // AdGroup=AddGroupList.FirstOrDefault(e => e.FindElement(By.CssSelector("div[style='word-wrap:break-word;font-weight:bold']")).Text.Contains(data.GroupName)); AdGroup = AddGroupList.FirstOrDefault(e => e.Text.Contains(data.GroupName)); return(AdGroup); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { AddGroupForm addGroupForm = new AddGroupForm(); addGroupForm.ShowDialog(); }
private void DoAdd() { ViewState view = GetViewState(); try { //add can be done only for users / groups if (view==ViewState.User) { AddUserForm addUserForm = new AddUserForm(console); addUserForm.ShowDialog(this); if (addUserForm.AddedUser) FillUsersList(); } else if (view==ViewState.Group) { AddGroupForm addGroupForm = new AddGroupForm(console); addGroupForm.ShowDialog(this); if (addGroupForm.AddedGroup) FillGroupsList(); } //Doesnt make sense to add Executors / Apps / Threads /Permissions manually. //permissions cant be added yet. they can only be assigned to groups } catch (AuthorizationException) { MessageBox.Show("Access denied. You do not have adequate permissions for this operation.","Authorization Error",MessageBoxButtons.OK, MessageBoxIcon.Error); } }