public Articles()
 {
     InitializeComponent();
     selectedArticle             = null;
     articlesRepo                = new App1CL.Repositories.ArticlesRepo();
     ArticlesGridView.DataSource = articlesRepo.Get();
 }
示例#2
0
 public Edit(App1CL.Models.Article _article)
 {
     InitializeComponent();
     articlesRepo            = new App1CL.Repositories.ArticlesRepo();
     article                 = _article;
     RefTextBox.Text         = article.Ref;
     DescriptionTextBox.Text = article.Description;
     PriceTextBox.Text       = article.Price.ToString();
 }
 private void ArticlesGridView_SelectionChanged(object sender, EventArgs e)
 {
     selectedArticle = new App1CL.Models.Article
     {
         Ref         = ArticlesGridView.CurrentRow.Cells["Ref"].Value.ToString(),
         Description = ArticlesGridView.CurrentRow.Cells["Description"].Value.ToString(),
         Price       = Convert.ToDecimal(ArticlesGridView.CurrentRow.Cells["Price"].Value)
     };
 }
示例#4
0
 public Remove(App1CL.Models.Article _article)
 {
     InitializeComponent();
     articlesRepo          = new App1CL.Repositories.ArticlesRepo();
     article               = _article;
     ReferenceLable.Text   = article.Ref;
     DescriptionLable.Text = article.Description;
     PriceLable.Text       = article.Price.ToString();
 }
示例#5
0
 public Add()
 {
     InitializeComponent();
     articlesRepo = new App1CL.Repositories.ArticlesRepo();
     article      = new App1CL.Models.Article()
     {
         Ref = Guid.NewGuid().ToString(),
     };
     RefTextBox.Text = article.Ref;
 }