Service.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. namespace Beauty
  11. {
  12. public partial class Service : Form
  13. {
  14. public Service()
  15. {
  16. InitializeComponent();
  17. }
  18. private void serviceBindingNavigatorSaveItem_Click(object sender, EventArgs e)
  19. {
  20. this.Validate();
  21. this.serviceBindingSource.EndEdit();
  22. this.tableAdapterManager.UpdateAll(this.makhanovISP42DataSet);
  23. }
  24. private void Service_Load(object sender, EventArgs e)
  25. {
  26. // TODO: данная строка кода позволяет загрузить данные в таблицу "makhanovISP42DataSet.service". При необходимости она может быть перемещена или удалена.
  27. this.serviceTableAdapter.Fill(this.makhanovISP42DataSet.service);
  28. }
  29. private void button1_Click(object sender, EventArgs e)
  30. {
  31. serviceBindingSource.AddNew();
  32. }
  33. private void button2_Click(object sender, EventArgs e)
  34. {
  35. serviceBindingSource.EndEdit();
  36. serviceTableAdapter.Update(makhanovISP42DataSet.service);
  37. }
  38. private void button3_Click(object sender, EventArgs e)
  39. {
  40. if (MessageBox.Show($"Вы точно хотите удалить выбранную запись?", "Внимание", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  41. {
  42. try
  43. {
  44. serviceBindingSource.RemoveCurrent();
  45. MessageBox.Show("Запись удалена");
  46. serviceTableAdapter.Update(makhanovISP42DataSet.service);
  47. }
  48. catch (Exception ex)
  49. {
  50. MessageBox.Show(ex.Message.ToString());
  51. }
  52. }
  53. }
  54. private void button4_Click(object sender, EventArgs e)
  55. {
  56. serviceBindingSource.MoveFirst();
  57. }
  58. private void button5_Click(object sender, EventArgs e)
  59. {
  60. serviceBindingSource.MoveLast();
  61. }
  62. private void button6_Click(object sender, EventArgs e)
  63. {
  64. serviceBindingSource.MoveNext();
  65. }
  66. private void button7_Click(object sender, EventArgs e)
  67. {
  68. serviceBindingSource.MovePrevious();
  69. }
  70. private void button8_Click(object sender, EventArgs e)
  71. {
  72. Form1 main = new Form1();
  73. main.Show();
  74. this.Hide();
  75. }
  76. }
  77. }