コード例 #1
0
        private void Record_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Rb_Yes.IsChecked == true)
                {
                    DataValue.RadioButton = "1";
                }
                else
                {
                    DataValue.RadioButton = "0";
                }

                string SetcurrentDate = DateTime.Now.ToString();
                string OnlyDate       = SetcurrentDate.Substring(0, SetcurrentDate.Length - 8);
                string currentDate    = OnlyDate.Replace(".", "-");
                currentDate = string.Join("-", currentDate.Split(new char[] { '-' }).Reverse());

                string Answer = new WebClient().DownloadString(url + "?date=" + Tb_Date.Text + "&diagnosis=" + Tb_Diagnos.Text + "&medication=" + Tb_Medication.Text + "&passed=" +
                                                               DataValue.RadioButton + "&currentDate=" + currentDate);

                DoctorWindows d = this.Owner as DoctorWindows;
                d.update_datagrid();

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
        private void Btn_Enter_Click(object sender, RoutedEventArgs e)
        {
            try {
                DataValue.Url = "http://myclinic.ddns.net:8080/Code/";
                Encoding source  = Encoding.Unicode;
                Encoding win1251 = Encoding.GetEncoding(1251);

                RegistryWindows      rw = new RegistryWindows();
                HeadPhysicianWindows hp = new HeadPhysicianWindows();
                DoctorWindows        dw = new DoctorWindows();
                AdminWindows         aw = new AdminWindows();
                string Answer           = new WebClient().DownloadString(DataValue.Url + "login.php?login="******"&password="******"*****@*****.**" && password == "admin")
                {
                    aw.Show();
                    this.Close();
                }
                else if (login == "*****@*****.**" && password == "registry")
                {
                    rw.Show();
                    this.Close();
                }
                else
                {
                    switch (str.ToLower())
                    {
                    case "главврач":
                    {
                        hp.Show();
                        this.Close();
                        break;
                    }

                    case "хирург":
                    {
                        dw.Show();
                        this.Close();
                        break;
                    }

                    case "окулист":
                    {
                        dw.Show();
                        this.Close();
                        break;
                    }

                    case "login empty":
                    {
                        Tb_Mail.BorderBrush     = System.Windows.Media.Brushes.Red;
                        Tb_Password.BorderBrush = System.Windows.Media.Brushes.Gray;
                        MessageBox.Show("Не введен логин");
                        break;
                    }

                    case "password empty":
                    {
                        Tb_Mail.BorderBrush     = System.Windows.Media.Brushes.Gray;
                        Tb_Password.BorderBrush = System.Windows.Media.Brushes.Red;
                        MessageBox.Show("Не введен пароль");
                        break;
                    }

                    case "empty":
                    {
                        Tb_Mail.BorderBrush     = System.Windows.Media.Brushes.Red;
                        Tb_Password.BorderBrush = System.Windows.Media.Brushes.Red;
                        MessageBox.Show("Поля пустые");
                        break;
                    }

                    case "":
                    {
                        Tb_Mail.BorderBrush     = System.Windows.Media.Brushes.Red;
                        Tb_Password.BorderBrush = System.Windows.Media.Brushes.Red;
                        MessageBox.Show("Введен неверный логин или пароль");
                        break;
                    }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }