Advertisement
JP_Bispo123

Untitled

Aug 29th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. using Database;
  2. using Model;
  3. using MongoDB.Driver;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Windows.Forms;
  9.  
  10.  
  11. namespace View
  12. {
  13.  
  14. public partial class ConsultaViabilidade : Form
  15. {
  16. public Estoque Global;
  17. public List<produtoHVEX> a;
  18. public List<Estoque> Lista_Compra;
  19.  
  20. public ConsultaViabilidade()
  21. {
  22. InitializeComponent();
  23. }
  24.  
  25. public void gerarprodutoHVEX()
  26. {
  27.  
  28. var prod = MongoConnection.QueryCollection("produtohvex", Builders<produtoHVEX>.Filter.Where(c => c.codHVEX == textBox1.Text), null).First() ;
  29. a = MongoConnection.QueryCollection("produtohvex", Builders<produtoHVEX>.Filter.Where(c => c.codHVEX == textBox1.Text), null);
  30. foreach (var produto in prod.ProductCollection)
  31. {
  32. if (produto.quantidade == 0)
  33. {
  34. button2.Enabled = false;
  35. Lista_Compra.Add(produto);
  36. }
  37. Global = produto;
  38. }
  39.  
  40. if (button2.Enabled)
  41. {
  42. button1.Enabled = false;
  43. }
  44.  
  45. }
  46.  
  47. private void button1_Click(object sender, EventArgs e)
  48. {
  49. Relatoriodeinsumos menu = new Relatoriodeinsumos();
  50. menu.Show();
  51. this.Visible = false;
  52. }
  53.  
  54. private void button2_Click(object sender, EventArgs e)
  55. {
  56. ListadeCompras menu = new ListadeCompras();
  57. menu.Show();
  58. this.Visible = false;
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement