private void authorizationRulesDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e) { using (var deleteForm = new DeleteForm(AuthorizationRuleDeleteMessage)) { e.Cancel = deleteForm.ShowDialog() == DialogResult.Cancel; } }
private void allDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { lock (obj) { if (messages == null || messages.Count == 0) { return; } DeleteForm form = new DeleteForm(); DialogResult dr = form.ShowDialog(); if (dr == DialogResult.Retry) { if (dm.deleteMess(messages[e.RowIndex])) { messages.RemoveAt(e.RowIndex); newmsg = messages.Where(m => m.status == STATUS.WAITING).ToList(); } } else if (dr == DialogResult.Ignore) { dm.deleteRecordToday(); messages.Clear(); newmsg.Clear(); } refresh(0); } } }
private void deleteProductToolStripMenuItem_Click(object sender, EventArgs e) { if (shop == null) { MessageBox.Show(StringConstant.AnyFileOpened); return; } if (!shop.IsBasketEmpty) { MessageBox.Show(StringConstant.BasketMustBeEmpty); return; } int index = searchDataGridView.CurrentRow.Index; if (index == -1) { MessageBox.Show(StringConstant.NoProductSelected); } else { string name = shop.SearchResult[index].Name; DeleteForm deleteForm = new DeleteForm( shop.SearchResult[index].Amount, shop.SearchResult[index].Measure); deleteForm.ShowDialog(); shop.DeleteFromStorage(name, deleteForm.Quantity); updateSearchBindingSource(); } }
public Object Delete(DeleteForm param) { if(param == null) throw new ArgumentException("param"); return dynamicFormInterface.DeleteForm(param); }
private void waitingDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { lock (obj) { if (newmsg == null || newmsg.Count == 0) { return; } DeleteForm form = new DeleteForm(); DialogResult dr = form.ShowDialog(); if (dr == DialogResult.Retry) { DataMessage message = newmsg[e.RowIndex + 5]; dm.deleteMess(message); newmsg.Remove(message); messages.Remove(message); } else if (dr == DialogResult.Ignore) { dm.deleteRecordWaitting(); foreach (DataMessage mess in newmsg) { messages.Remove(mess); } newmsg.Clear(); } refresh(0); } } }
public BaseForm getForm(typeForm type, AbstractController controller, string tableName) { BaseForm res = null; switch (type) { case typeForm.ADD: res = new AddForm(controller, tableName); return(res); case typeForm.READ: res = new ReadForm(controller, tableName); return(res); case typeForm.UPDATE: res = new UpdateForm(controller, tableName); return(res); case typeForm.DELETE: res = new DeleteForm(controller, tableName); return(res); default: return(res); } }
public BaseForm getForm(typeForm type, string cnnString, string tableName, BaseForm rootForm) { BaseForm res = null; switch (type) { case typeForm.ADD: res = new AddForm(cnnString, tableName); return(res); case typeForm.READ: res = new ReadForm(cnnString, tableName); return(res); case typeForm.UPDATE: res = new UpdateForm(cnnString, tableName); return(res); case typeForm.DELETE: res = new DeleteForm(cnnString, tableName); return(res); case typeForm.HASFORMS: res = new FormHasForms(cnnString, tableName, rootForm); return(res); default: return(res); } }
private void DeleteButton_Click(object sender, EventArgs e)//Delete swimmers { Form deletetest = new DeleteForm(); deletetest.ShowDialog(); LoadData(); }
public void OnGet(string id) { DeleteForm = new DeleteForm { Id = id }; }
public ActionResult Delete(int projectId) { C.Project Project = ProjectService.GetProjectById(projectId); C.Employee Manager = EmployeeService.Get((int)ProjectService.GetProjectManagerId(projectId)); C.Employee Creator = EmployeeService.Get(Project.CreatorId); DeleteForm Form = new DeleteForm(Project, Manager, Creator); return(View(Form)); }
private void btnCreateDelete_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null || ruleWrapper == null || ruleWrapper.SubscriptionDescription == null) { return; } if (btnCreateDelete.Text == RemoveText && ruleWrapper.SubscriptionDescription != null && !string.IsNullOrWhiteSpace(ruleWrapper.SubscriptionDescription.Name) && ruleWrapper.RuleDescription != null && !string.IsNullOrWhiteSpace(ruleWrapper.RuleDescription.Name)) { using (var deleteForm = new DeleteForm(ruleWrapper.RuleDescription.Name, RuleEntity.ToLower())) { if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.RemoveRule(ruleWrapper.SubscriptionDescription, ruleWrapper.RuleDescription); } } return; } if (btnCreateDelete.Text == AddText) { if (string.IsNullOrWhiteSpace(txtName.Text)) { writeToLog(NameCannotBeNull); return; } var ruleDescription = new RuleDescription(txtName.Text); if (!string.IsNullOrWhiteSpace(txtSqlFilterExpression.Text)) { ruleDescription.Filter = new SqlFilter(txtSqlFilterExpression.Text); } if (!string.IsNullOrWhiteSpace(txtSqlFilterAction.Text)) { ruleDescription.Action = new SqlRuleAction(txtSqlFilterAction.Text); } ruleWrapper.RuleDescription = serviceBusHelper.AddRule(ruleWrapper.SubscriptionDescription, ruleDescription); InitializeData(); } } catch (Exception ex) { HandleException(ex); } }
// GET: Admin/Team/Delete/5 public ActionResult Delete(int id) { C.Team Team = TeamService.GetTeamById(id); DeleteForm form = new DeleteForm() { Team_Id = (int)Team.Id, Name = Team.Name, Created = Team.Created, Creator_Id = Team.Creator_Id, Project_Id = Team.Project_Id }; return(View(form)); }
// GET: Admin/Department/Delete/5 public ActionResult Delete(int id) { C.Department Department = DepartmentService.GetDepartmentById(id); DeleteForm form = new DeleteForm { Id = (int)Department.Id, Title = Department.Title, Created = Department.Created, Description = Department.Description, Admin_Id = Department.Admin_Id, Admin = null }; return(View(form)); }
public override async Task <bool> DeleteAsync(int id) { var deleteForm = new DeleteForm(UserRepository, ProjectRepository, GroupMembershipRepository, UserRolesRepository, CurrentUserContext); if (!deleteForm.IsValid(id)) { throw new JsonApiException(deleteForm.Errors); } return(await base.DeleteAsync(id)); }
public ActionResult Delete(int id, DeleteForm form) { //C.Event e = new C.Event(form.Id, form.CreatorId, null, form.Name, form.Description, form.Address, form.StartDate, form.EndDate, form.CreationDate, null, form.OpenSubscription, false); C.Event e = new C.Event(); e.Id = id; try { EventService.Delete(e, SessionUser.GetUser().Id); } catch (System.Data.SqlClient.SqlException Exception) { throw Exception; } return(RedirectToAction("Index")); }
public ActionResult Delete(int id, DeleteForm form) { if (id == form.Id) { try { DepartmentService.Delete(SessionUser.GetUser().Id, form.Id); return(RedirectToAction("Index")); } catch (Exception ex) { throw ex; } } return(View(form)); }
private void btnCreateDelete_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null) { return; } if (btnCreateDelete.Text == DeleteText) { using (var deleteForm = new DeleteForm(consumerGroupDescription.Name, ConsumerGroupEntity.ToLower())) { if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteConsumerGroup(consumerGroupDescription); } } } else { if (string.IsNullOrWhiteSpace(txtName.Text)) { writeToLog(PathCannotBeNull); return; } //var description = new ConsumerGroupDescription(eventHubName, txtName.Text) // { // UserMetadata = txtUserMetadata.Text, // EnableCheckpoint = checkBoxEnableCheckpoint.Enabled // }; var description = new ConsumerGroupDescription(eventHubName, txtName.Text) { UserMetadata = txtUserMetadata.Text }; consumerGroupDescription = serviceBusHelper.CreateConsumerGroup(description); InitializeControls(); } } catch (Exception ex) { HandleException(ex); } }
public ActionResult Delete(int id) { C.Event Event = EventService.Get(id); DeleteForm form = new DeleteForm { Id = (int)Event.Id, CreatorId = Event.CreatorId, Name = Event.Title, Description = Event.Description, DepartmentId = Event.DepartmentId, Address = Event.Address, StartDate = Event.Start, EndDate = Event.End, CreationDate = Event.Created }; return(View(form)); }
public ActionResult Delete(DeleteForm form) { if (ModelState.IsValid) { C.Project p = new C.Project(form.ProjectId, form.Name, form.Description, form.StartDate, form.EndDate, (int)form.Creator.Employee_Id, (int)form.ProjectManager.Employee_Id); try { if (ProjectService.Delete(p, SessionUser.GetUser().Id)) { return(RedirectToAction("Index")); } } catch (System.Data.SqlClient.SqlException Exception) { throw Exception; } } return(View(form)); }
public ActionResult Delete(int teamId) { int Employee_Id = SessionUser.GetUser().Id; D.Team Team = TeamService.GetTeamById(teamId); if (AuthService.IsAdmin(Employee_Id) || ProjectService.GetProjectManagerId(Team.Project_Id) == Employee_Id) { DeleteForm form = new DeleteForm() { Team_Id = (int)Team.Id, Name = Team.Name, Created = Team.Created, Creator_Id = Team.Creator_Id, Project_Id = Team.Project_Id }; return(View(form)); } return(RedirectToAction("Index")); }
public ActionResult Delete(int teamId, DeleteForm form) { if (ModelState.IsValid) { if (teamId == form.Team_Id) { D.Team Team = new D.Team(form.Team_Id, form.Name, form.Created, null, form.Creator_Id, form.Project_Id, null); try { if (TeamService.Delete(Team, SessionUser.GetUser().Id)) { return(RedirectToAction("Index")); } } catch (System.Data.SqlClient.SqlException Exception) { throw Exception; } } } return(View(form)); }
private void btn_delete_Click(object sender, EventArgs e) { DeleteForm delForm = new DeleteForm(); delForm.ShowDialog(); }
private void btnCreateDelete_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null) { return; } if (btnCreateDelete.Text == DeleteText) { using (var deleteForm = new DeleteForm(eventHubDescription.Path, EventHubEntity.ToLower())) { if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteEventHub(eventHubDescription); } } } else { if (string.IsNullOrWhiteSpace(txtPath.Text)) { writeToLog(PathCannotBeNull); return; } var description = new EventHubDescription(txtPath.Text) { UserMetadata = txtUserMetadata.Text }; description.MessageRetentionInDays = trackBarMessageRetentionInDays.Value; description.PartitionCount = trackBarPartitionCount.Value; var bindingList = authorizationRulesBindingSource.DataSource as BindingList <AuthorizationRuleWrapper>; if (bindingList != null) { for (var i = 0; i < bindingList.Count; i++) { var rule = bindingList[i]; if (serviceBusHelper.IsCloudNamespace) { if (string.IsNullOrWhiteSpace(rule.KeyName)) { writeToLog(string.Format(KeyNameCannotBeNull, i)); continue; } } var rightList = new List <AccessRights>(); if (rule.Manage) { rightList.AddRange(new[] { AccessRights.Manage, AccessRights.Send, AccessRights.Listen }); } else { if (rule.Send) { rightList.Add(AccessRights.Send); } if (rule.Listen) { rightList.Add(AccessRights.Listen); } } if (serviceBusHelper.IsCloudNamespace) { if (string.IsNullOrWhiteSpace(rule.SecondaryKey)) { description.Authorization.Add(new SharedAccessAuthorizationRule(rule.KeyName, rule.PrimaryKey ?? SharedAccessAuthorizationRule.GenerateRandomKey(), rightList)); } else { description.Authorization.Add(new SharedAccessAuthorizationRule(rule.KeyName, rule.PrimaryKey ?? SharedAccessAuthorizationRule.GenerateRandomKey(), rule.SecondaryKey ?? SharedAccessAuthorizationRule.GenerateRandomKey(), rightList)); } } else { description.Authorization.Add(new AllowRule(rule.IssuerName, rule.ClaimType, rule.ClaimValue, rightList)); } } } eventHubDescription = serviceBusHelper.CreateEventHub(description); InitializeControls(); } } catch (Exception ex) { HandleException(ex); } }
private void DeleteButton_Click(object sender, EventArgs e) { try { DeleteForm deleteForm = new DeleteForm(); List <FileSystemInfo> checkedfilesAndDirectories = new List <FileSystemInfo>(); if (isLeftActive) { foreach (ListViewItem item in LeftListView.SelectedItems) { if (item.SubItems[2].Text.Equals("<папка>")) { checkedfilesAndDirectories.Add(new DirectoryInfo(Path.Combine(LeftViewRootPath, item.SubItems[0].Text))); } else if (!item.SubItems[0].Text.Equals("...")) { string filename = item.SubItems[0].Text; if (item.SubItems[1].Text != "") { filename = filename + "." + item.SubItems[1].Text; } checkedfilesAndDirectories.Add(new FileInfo(Path.Combine(LeftViewRootPath, filename))); } } if (checkedfilesAndDirectories.Count == 0) { deleteForm.Dispose(); return; } deleteForm.SetParametres(checkedfilesAndDirectories); } else { foreach (ListViewItem item in RightListView.SelectedItems) { if (item.SubItems[2].Text.Equals("<папка>")) { checkedfilesAndDirectories.Add(new DirectoryInfo(Path.Combine(RightViewRootPath, item.SubItems[0].Text))); } else if (!item.SubItems[0].Text.Equals("...")) { string filename = item.SubItems[0].Text; if (item.SubItems[1].Text != "") { filename = filename + "." + item.SubItems[1].Text; } checkedfilesAndDirectories.Add(new FileInfo(Path.Combine(RightViewRootPath, filename))); } } if (checkedfilesAndDirectories.Count == 0) { deleteForm.Dispose(); return; } deleteForm.SetParametres(checkedfilesAndDirectories); } deleteForm.Show(); } catch (Exception ex) { MessageBox.Show("FATAL: " + ex.Message + "\n" + ex.StackTrace); } }
void btnCreateDelete_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null || ruleWrapper?.SubscriptionDescription == null) { return; } if (btnCreateDelete.Text == RemoveText && !string.IsNullOrWhiteSpace(ruleWrapper.SubscriptionDescription?.Name) && !string.IsNullOrWhiteSpace(ruleWrapper.RuleDescription?.Name)) { using (var deleteForm = new DeleteForm(ruleWrapper.RuleDescription.Name, RuleEntity.ToLower())) { if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.RemoveRule(ruleWrapper.SubscriptionDescription, ruleWrapper.RuleDescription); } } return; } if (btnCreateDelete.Text != AddText) { return; } if (string.IsNullOrWhiteSpace(txtName.Text)) { writeToLog(NameCannotBeNull); return; } var ruleDescription = new RuleDescription(txtName.Text); if (checkBoxIsCorrelationFilter.Checked) { var filter = new CorrelationFilter() { ContentType = (!string.IsNullOrWhiteSpace(txtCorrelationFilterContentType.Text) ? txtCorrelationFilterContentType.Text : null), CorrelationId = (!string.IsNullOrWhiteSpace(txtCorrelationFilterCorrelationId.Text) ? txtCorrelationFilterCorrelationId.Text : null), Label = (!string.IsNullOrWhiteSpace(txtCorrelationFilterLabel.Text) ? txtCorrelationFilterLabel.Text : null), MessageId = (!string.IsNullOrWhiteSpace(txtCorrelationFilterMessageId.Text) ? txtCorrelationFilterMessageId.Text : null), ReplyTo = (!string.IsNullOrWhiteSpace(txtCorrelationFilterReplyTo.Text) ? txtCorrelationFilterReplyTo.Text : null), ReplyToSessionId = (!string.IsNullOrWhiteSpace(txtCorrelationFilterReplyToSessionId.Text) ? txtCorrelationFilterReplyToSessionId.Text : null), SessionId = (!string.IsNullOrWhiteSpace(txtCorrelationFilterSessionId.Text) ? txtCorrelationFilterSessionId.Text : null), To = (!string.IsNullOrWhiteSpace(txtCorrelationFilterTo.Text) ? txtCorrelationFilterTo.Text : null) }; if (userPropertyBindingList != null) { foreach (var prop in userPropertyBindingList) { filter.Properties.Add(prop.Name, prop.Value); } } ruleDescription.Filter = filter; } else { if (!string.IsNullOrWhiteSpace(txtFilterExpression.Text)) { ruleDescription.Filter = new SqlFilter(txtFilterExpression.Text); } } if (!string.IsNullOrWhiteSpace(txtSqlFilterAction.Text)) { ruleDescription.Action = new SqlRuleAction(txtSqlFilterAction.Text); } ruleWrapper.RuleDescription = serviceBusHelper.AddRule(ruleWrapper.SubscriptionDescription, ruleDescription); InitializeData(); } catch (Exception ex) { HandleException(ex); } }
// ReSharper disable once FunctionComplexityOverflow private async void btnCreateDelete_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null) { return; } if (btnCreateDelete.Text == DeleteText) { using (var deleteForm = new DeleteForm(relayDescription.Path, RelayEntity.ToLower())) { if (deleteForm.ShowDialog() == DialogResult.OK) { await serviceBusHelper.NamespaceManager.DeleteRelayAsync(relayDescription.Path); //serviceBusHelper.DeleteRelay(relayDescription.Path); } } } else { if (string.IsNullOrWhiteSpace(txtPath.Text)) { writeToLog(PathCannotBeNull); return; } var description = new RelayDescription(txtPath.Text, (RelayType)Enum.Parse(typeof(RelayType), cboRelayType.Text, true)) { UserMetadata = txtUserMetadata.Text, RequiresClientAuthorization = checkedListBox.GetItemChecked(RequiresClientAuthorizationIndex), RequiresTransportSecurity = checkedListBox.GetItemChecked(RequiresTransportSecurityIndex) }; var bindingList = authorizationRulesBindingSource.DataSource as BindingList <AuthorizationRuleWrapper>; if (bindingList != null) { for (var i = 0; i < bindingList.Count; i++) { var rule = bindingList[i]; if (serviceBusHelper.IsCloudNamespace) { if (string.IsNullOrWhiteSpace(rule.KeyName)) { writeToLog(string.Format(KeyNameCannotBeNull, i)); continue; } } var rightList = new List <AccessRights>(); if (rule.Manage) { rightList.AddRange(new[] { AccessRights.Manage, AccessRights.Send, AccessRights.Listen }); } else { if (rule.Send) { rightList.Add(AccessRights.Send); } if (rule.Listen) { rightList.Add(AccessRights.Listen); } } if (serviceBusHelper.IsCloudNamespace) { if (string.IsNullOrWhiteSpace(rule.SecondaryKey)) { description.Authorization.Add(new SharedAccessAuthorizationRule(rule.KeyName, rule.PrimaryKey ?? SharedAccessAuthorizationRule.GenerateRandomKey(), rightList)); } else { description.Authorization.Add(new SharedAccessAuthorizationRule(rule.KeyName, rule.PrimaryKey ?? SharedAccessAuthorizationRule.GenerateRandomKey(), rule.SecondaryKey ?? SharedAccessAuthorizationRule.GenerateRandomKey(), rightList)); } } else { description.Authorization.Add(new AllowRule(rule.IssuerName, rule.ClaimType, rule.ClaimValue, rightList)); } } } relayDescription = serviceBusHelper.CreateRelay(description); InitializeControls(); } } catch (Exception ex) { HandleException(ex); } }