private void button1_Click(object sender, EventArgs e) { if (IsChanged) { Record = new CallRecord(); Record.ID = ID; Record.Date = DateBox.Text; Record.Time = TimeBox.Text; Record.Name = NameBox.Text; Record.Phone = PhoneBox.Text; Record.Type = "None"; Record.Brand = "None"; Record.Reason = ReasonBox.Text; Record.Status = CallRecord.StringToStatus(StatusBox.Text); Record.RecallDate = RecallBox.Text; Record.DiagnosticDate = DiagnosticBox.Text; if (MySQLWork.GetInstance().UpdateRecord(Record)) { MessageBox.Show("Запись обновлена"); this.Close(); } else { MessageBox.Show("Ошибка сохранения, сделай скрин ошибки и пришли (в следующий раз)"); } } else { MessageBox.Show("Изменений нет"); } }
private void SetRecord() { this.Text = this.Text + " №" + ID.ToString(); Record = MySQLWork.GetInstance().GetRecord(ID); DateBox.Text = Record.Date; TimeBox.Text = Record.Time; NameBox.Text = Record.Name; PhoneBox.Text = Record.Phone; ReasonBox.Text = Record.Reason; StatusBox.Text = CallRecord.StatusToString(Record.Status); RecallBox.Text = Record.RecallDate; DiagnosticBox.Text = Record.DiagnosticDate; }
public MainForm() { InitializeComponent(); fc = FormController.GetInstance(); fc.mainForm = this; SettingsReader.Load(); msql = MySQLWork.GetInstance(); msql.RecordReceived += SetRecords; msql.RecordReceived += SetUntergeted; msql.RecordReceived += SetDiagnostics; msql.RecordReceived += SetAllRecieved; msql.RecordReceived += SetRecallsToday; msql.RowsAffected += ShowRowsAffected; msql.RecordReceived += UpdateLabels; }
private void ApllicationViewer_FormClosing(object sender, FormClosingEventArgs e) { msql = null; this.Dispose(); }
public ApllicationViewer() { InitializeComponent(); msql = MySQLWork.GetInstance(); }