示例#1
0
 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");
         }
     }
 }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
        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();
                }
            }
        }