コード例 #1
0
        private void Login_Form_Load(object sender, EventArgs e)
        {
            //Properties.Settings.Default.UserName = "******";  //String.Empty;
            //Properties.Settings.Default.Save();
            //MessageBox.Show(Properties.Settings.Default.UserName);
            //MedecinController.UpdatePasword("azerty", 23);
            //MessageBox.Show(MedecinController.GetDocData().ToString());
            //MessageBox.Show(MedecinController.error);

            checkInternetConnection();


            this.Name = "MainForm";

            if (Properties.Settings.Default.UserName != String.Empty)
            {
                this.WindowState   = FormWindowState.Minimized;
                this.ShowInTaskbar = false;
                if (MedecinController.GetDocData())
                {
                    hf.Show();
                }

                else
                {
                    Properties.Settings.Default.UserName = String.Empty;
                }
            }
            else
            {
                this.WindowState   = FormWindowState.Normal;
                this.ShowInTaskbar = true;
            }
        }
コード例 #2
0
 private void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         MedecinController.UpdateData(Medecin.Id_doc, txt_username.Text, text_nom.Text, txt_prenom.Text, txt_tel.Text, txt_email.Text, txt_ville.Text, txt_adresse.Text, txt_facebook.Text, txt_whatsapp.Text, txt_instagram.Text, txt_twitter.Text, txt_linkeden.Text);
         MedecinController.GetDocData();
         Properties.Settings.Default.UserName = txt_username.Text;
         Home_Form.dataUpdated = true;
         OperationDone_Form op = new OperationDone_Form();
         op.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
 private void btn_login_Click(object sender, EventArgs e)
 {
     if (txt_UserName.Text != String.Empty && txt_Password.Text != String.Empty)
     {
         if (MedecinController.Login(txt_UserName.Text, txt_Password.Text) > 0)
         {
             Properties.Settings.Default.UserName = txt_UserName.Text;
             Properties.Settings.Default.Save();
             MedecinController.GetDocData();
             Task.Delay(1000);
             OpenForm();
         }
         else
         {
             //
             MessageBox.Show("incorrect user name or password!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("merci de remplire tout les champs!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }