public UpdateEventForm(EventForm mainForm, int id) { InitializeComponent(); mainF = mainForm; event_ = new Event(id); id_txtBox.Text = event_.id.ToString(); type_txtBox.Text = event_.type; place_txtBox.Text = event_.place; date_txtBox.Text = event_.date.ToString("yyyy-MM-dd"); time_txtBox.Text = event_.date.ToString("HH:mm"); }
public CreateEventForm(EventForm mainForm, int id, bool update) { InitializeComponent(); this.update = update; mainF = mainForm; if (update) { event_ = new Event(id); //id_txtBox.Text = event_.id.ToString(); name_txtBox.Text = event_.name; type_txtBox.Text = event_.type; place_txtBox.Text = event_.place; date_txtBox.Text = event_.date.ToString("yyyy-MM-dd"); time_txtBox.Text = event_.date.ToString("HH:mm"); } //InitializeComponent(); }
private void enter_btn_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(login_txtBox.Text) && !string.IsNullOrWhiteSpace(password_txtBox.Text)) { Error res = TransactionScripts.auth(login_txtBox.Text, password_txtBox.Text); if (!res.error) { EventForm ef = new EventForm(new User(login_txtBox.Text), this); ef.Show(); this.Hide(); } else { DialogResult result = MessageBox.Show( res.message, "Не успешно", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } }