private void refresh() { activity = WorkerSection.Appoitments(worker); display.Columns.Clear(); display.DataSource = activity; for (int i = 0; i < 7; i++) { display.AutoResizeColumn(i); } display.ClearSelection(); updateButton.Enabled = false; }
private void updateButton_Click(object sender, EventArgs e) { bool success; switch (updateBox.SelectedIndex) { case 1: success = WorkerSection.UpdateApoitment(select, "pro", null, false); break; case 2: success = WorkerSection.UpdateApoitment(select, "fin", null, true); break; case 3: Result data = new Result(); data.ShowDialog(this); if (data.result == "" || data.result == null) { success = true; break; } success = WorkerSection.UpdateApoitment(select, "can", data.result, true); break; default: success = false; break; } if (success == false) { MessageBox.Show("tup"); } this.Close(); }