private void CriteriaBTN_Click(object sender, EventArgs e) { var criteriaWindow = new AddCriteria(); Hide(); criteriaWindow.ShowDialog(); Show(); }
public async Task <ActionResult> AddCriterion([FromBody] AddCriteria criteria) { try { var result = await _contestService.AddCriterion(criteria); return(Result.Ok(result)); } catch (Exception ex) { return(Result.Error(ex)); } }
public async Task <bool> AddCriterion(AddCriteria criteria) { try { _dbContext.Criterias.Add(new Criteria { ContestId = int.Parse(criteria.ContestId), Description = criteria.Description, Name = criteria.Name }); await _dbContext.SaveChangesAsync(); return(true); } catch (Exception ex) { return(false); } }
private void AddSearchCriteriaToolStripMenuItemClick(object sender, EventArgs e) { AddCriteria?.Invoke(sender, e); RefreshNeeded?.Invoke(sender, e); }