コード例 #1
0
        //
        private void AddArticle()
        {
            var addWindow = new AddArticle(false, null);

            if (addWindow.ShowDialog() ?? false)
            {
                _model.SelectedResearcher.AddArticle(addWindow.Article);
            }
        }
コード例 #2
0
        private void Add_Article()
        {
            AddArticle AddArticle = new AddArticle()
            {
                StartPosition = FormStartPosition.CenterParent
            };

            AddArticle.ShowDialog(this);
        }
コード例 #3
0
        private void toolStripMenuItemAjouter_Click(object sender, EventArgs e)
        {
            Console.WriteLine("123");
            AddArticle AddArticle = new AddArticle()
            {
                StartPosition = FormStartPosition.CenterParent
            };

            AddArticle.ShowDialog(this);
            LoadListView();
        }
コード例 #4
0
        /// <summary>
        /// strip add item click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddArticleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddArticle Add_Article = new AddArticle();

            Add_Article.ShowDialog(this);

            if (Add_Article.DialogResult == DialogResult.OK)
            {
                listView_ShowBD_DataBinding();
                this.ToolStripStatusLabel.Text = "You have added an article!";
            }
        }
コード例 #5
0
        public void Post([FromBody] AddArticle value)
        {
            var article = new Article();

            article.Header      = value.Header;
            article.Summary     = value.Summary;
            article.Img         = value.Img;
            article.Body        = value.Body;
            article.Link        = value.Link;
            article.Source      = value.Source;
            article.Publishdate = value.Publishdate;
            articleService.AddArticle(article, value.Tags);
        }
コード例 #6
0
        public AddArticle Get(int id)
        {
            var a = articleService.GetArticleWithTagsById(id);
            var x = new AddArticle()
            {
                Header      = a.Item1.Header,
                Body        = a.Item1.Body,
                Img         = a.Item1.Img,
                Link        = a.Item1.Link,
                Source      = a.Item1.Source,
                Summary     = a.Item1.Summary,
                Publishdate = a.Item1.Publishdate,
                Tags        = a.Item2
            };

            return(x);
        }
コード例 #7
0
 public ActionResult Add(AddArticle model)
 {
     if (ModelState.IsValid)
     {
         Article newArticle = new Article
         {
             CompanyId = AppSettings.CurrentCompany,
             CreateDate = DateTime.Now,
             PageId = (int)PagesEnum.About,
             Text = model.Text,
             Title = model.Title,
             Author = brioContext.CurrentUser.ID
         };
         articleRepository.Insert(newArticle);
         articleRepository.SaveChanges();
         return RedirectToAction("About");
     }
     else
         return View(model);
 }
コード例 #8
0
        private void AddNewArticle()
        {
            AddArticle add = new AddArticle(txtAddProductName.Text, txtAddProductDescription.Text, decimal.Parse(txtAddProductPrice.Text), cbAddProductCategory.Text);

            add.Add_or_edit();
        }
コード例 #9
0
        private void EditArticle()
        {
            var addWindow = new AddArticle(true, _model.SelectedArticle);

            addWindow.ShowDialog();
        }
コード例 #10
0
 public async Task <ArticleModel> Post([FromBody] AddArticle model)
 {
     return(_mapper.Map <ArticleModel>(await _articleService.CreateArticle(_mapper.Map <ArticleDTO>(model))));
 }