fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Sfera_CRM
  12. {
  13. public partial class ViewsContractsFRM : Form
  14. {
  15. public ViewsContractsFRM()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. Mapping mp = new Mapping();
  21.  
  22. private void ViewsContractsFRM_Load(object sender, EventArgs e)
  23. {
  24. // TODO: данная строка кода позволяет загрузить данные в таблицу "crmDB_resDataSet.Contracts". При необходимости она может быть перемещена или удалена.
  25. this.contractsTableAdapter.Fill(this.crmDB_resDataSet.Contracts);
  26.  
  27. }
  28.  
  29. private void back_Click(object sender, EventArgs e)
  30. {
  31. update_data();
  32. Config.forms["menuFRM"].Show();
  33. Hide();
  34. }
  35.  
  36. public void update_data()
  37. {
  38. dataGridView1.DataSource = null;
  39. dataGridView1.DataSource = mp.Show("SELECT * FROM Contracts");
  40. }
  41.  
  42. private void Close_order_Click(object sender, EventArgs e)
  43. {
  44.  
  45. string contract_id = dataGridView1.CurrentRow.Cells[0].Value.ToString();
  46. string manager_id = dataGridView1.CurrentRow.Cells[2].Value.ToString();
  47. string close_date = dataGridView1.CurrentRow.Cells[6].Value.ToString();
  48. if (Config.right == "0" && manager_id != Config.user_id)
  49. {
  50. MessageBox.Show("Вы не можете закрывать чужие договора");
  51. }
  52. else if (close_date.Length > 4)
  53. {
  54. MessageBox.Show("Договор уже закрыт");
  55. }
  56. else
  57. {
  58. mp.CRUD("UPDATE Contracts SET Close_date=" + DateTime.Now.ToString("dd-MM-yyyy") + " WHERE Contracts_id = " + contract_id);
  59. MessageBox.Show("Договор №" + contract_id + " успешно закрыт");
  60. update_data();
  61.  
  62. }
  63.  
  64. }
  65.  
  66. private void button1_Click(object sender, EventArgs e)
  67. {
  68. update_data();
  69. }
  70. }
  71. }
  72.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference?
prog.cs(9,22): error CS0234: The type or namespace name `Forms' does not exist in the namespace `System.Windows'. Are you missing `System.Windows.Forms' assembly reference?
prog.cs(13,46): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
prog.cs(20,9): error CS0246: The type or namespace name `Mapping' could not be found. Are you missing an assembly reference?
Compilation failed: 4 error(s), 0 warnings
stdout
Standard output is empty