private void Add_Button_Click(object sender, RoutedEventArgs e) { MainWindow main = Application.Current.Windows.OfType <MainWindow>().First(); article _article = new article() { bibtexkey = bibtexKey_Txt.Text, title = title_Txt.Text, year = year_Txt.Text != "" ? Convert.ToInt32(year_Txt.Text) : null as int?, number = number_Txt.Text != "" ? Convert.ToInt32(number_Txt.Text) : null as int?, month = month_Txt.Text != "" ? Convert.ToInt32(month_Txt.Text) : null as int?, volume = volume_Txt.Text != "" ? Convert.ToInt32(volume_Txt.Text) : null as int?, author = author_Txt.Text, journal = journal_Txt.Text, pages = pages_Txt.Text, note = note_Txt.Text, doi = doi_Txt.Text, entrytype = GetEntryType.GetValueByEnum(GetEntryType.EntryType.Article) }; bool result = AllFieldEmpty(); if (!result) { _iArticleService.Add(_article); SetFieldClear(); UIElement parent = App.Current.MainWindow; parent.IsEnabled = true; main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes(); this.Close(); } else { if (MessageBox.Show("Are you Sure to create a empty .bib", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) { //do no stuff return; } else { _iArticleService.Add(_article); SetFieldClear(); main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes(); UIElement parent = App.Current.MainWindow; parent.IsEnabled = true; this.Close(); //do yes stuff } } //var r=Application.Current.Windows.OfType<W_MessageBox>(); }
public void Add(ArticleDto data) { var article = new Article { Title = data.Title, Content = data.Content }; _articleDal.Add(article); }
public IActionResult Post([FromBody] ArticleModel value) { if (value == null) { return(BadRequest()); } value.CreatedDate = DateTime.Parse(DateTime.Now.ToString("MM/dd/yyyy hh:mm")); _articleDal.Add(_mapper.Map <Article>(value)); return(Ok(_mapper.Map <ArticleModel>(value))); }
public IResult Add(Article article) { var result = _articleDal.Find(p => p.Title == article.Title); if (result != null) { return(new ErrorResult("This Article already added")); } _articleDal.Add(article); return(new SuccessResult("Your Article successfully posted")); }
public async Task <ActionResult <Article> > PostArticle(Article article) { System.Threading.Thread.Sleep(1000); article.CategoryId = article.Category.Id; article.Category = null; article.ViewCount = 0; article.PublishDate = DateTime.Now; await _articleDal.Add(article); return(Ok()); }
public bool Add(Article article) { try { _articleDal.Add(article); return(true); } catch (Exception) { return(false); } }
public IActionResult Add([FromBody] ArticleInfo articleInfo) { try { _articleDal.Add(articleInfo); return(new StatusCodeResult(201)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
//[SecuredOperation("author,admin,moderator")] public IResult ArticleAdd(Article article) { article.Date = DateTime.Now; var result = BusinessRules.Run(IfTheseArticlesContain(article.Writing), CheckArticleTitleExists(article.Title), CheckDate(article.Date)); if (result != null) { return(result); } _articleDal.Add(article); return(new SuccessResult(Messages.SuccessAdded)); }
public IResult Add(Article article) { _articleDal.Add(article); return(new SuccessResult(ArticleMessage.ArticleAdded)); }
public async Task AddArticle(Article article) { await _articleDal.Add(article); }
public IResult Add(Article article) { //business code _articleDal.Add(article); return(new SuccessResult("Ürün başarıyla kaydedildi")); }
public IResult Add(Article article) { _articleDal.Add(article); return(new SuccessResult(Messages.Success)); }
public string Add(Article article) { _IArticleDal.Add(article); return("Makale başarıyla eklendi"); }
public void Add(Articles entity) { _articleDal.Add(entity); }
public void Add(Article product) { _articleDal.Add(product); }
public void Add(Article article) { _articleDal.Add(article); }