private void button1_Click(object sender, EventArgs e) { if (EmailBox.Text == Shop.Admin.Name && PasswordBox.Text == Shop.Admin.Password) { MainForm adm = new MainForm(Shop); Hide(); EmailBox.Text = ""; PasswordBox.Text = ""; adm.Show(); } else { string email = EmailBox.Text; string password = PasswordBox.Text; Client client = Shop.SearchClient(email); if (client != null && client.Password == password) { ClientInfoForm clientF = new ClientInfoForm(client, Shop, true); Hide(); EmailBox.Text = ""; PasswordBox.Text = ""; clientF.Show(); } else { MessageBox.Show("Wrong"); } } }
private void barButtonItemNewClient_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { // Show the edit form for the client ClientInfoForm frm = new ClientInfoForm { EditMode = false }; if (frm.ShowDialog() == DialogResult.OK) { FillClientTreeView(); } }
public void EditClientInfoContextMenuHandler(object sender, EventArgs e) { Appointment appt = schedulerControlMain.SelectedAppointments[0]; if (appt.CustomFields["ClientId"] != null) { int clientId = (int)appt.CustomFields["ClientId"]; ClientInfoForm frm = new ClientInfoForm { EditMode = true, ClientId = clientId }; frm.ShowDialog(); } }
private void barButtonItemEditClient_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int currentId = GetSelectedNodeId(); if (currentId < 0) { currentId = ProgressNoteInformation.ReturnClientIdFromNote(Math.Abs(currentId)); } // Show the edit form for the client if (currentId > 0) { ClientInfoForm frm = new ClientInfoForm { EditMode = true, ClientId = currentId }; if (frm.ShowDialog() == DialogResult.OK) { FillClientTreeView(); } } }