예제 #1
0
        void edit(object sender, EventArgs e)
        {
            if (!umei.Text.Equals(null) && !uid.Text.Equals(null) && !umei.Text.Equals("") && !uid.Text.Equals(""))
            {
                DBConnect.Connect("kasiihara.db");
//                SQL = "UPDATE t_user WHERE user_id = '"+ Application.Current.Properties["e_id"].ToString() + "' SET user_name = '" + umei.Text + "',login_id = '" + uid + "'";
                SQL = "UPDATE t_user SET user_name = '" + umei.Text + "',login_id = '" + uid.Text + "',user_name_kana = '" + umei_kana.Text + "' WHERE user_id = '" + int.Parse(Application.Current.Properties["e_id"].ToString()) + "'";
                DBConnect.ExecuteReader(SQL);
                DBConnect.Dispose();


                //送信するデータ格納
                Application.Current.Properties["henshuu"]     = "2";
                Application.Current.Properties["rename"]      = umei.Text;
                Application.Current.Properties["reid"]        = uid.Text;
                Application.Current.Properties["rename_kana"] = umei_kana.Text;
                Application.Current.Properties["rename_type"] = type;
                //送信先、遷移先を設定
                var nextPage = new UserManagiment();
                NavigationService.Navigate(nextPage);

                //MessageBox.Show("編集が完了しました");
            }
            else
            {
                MessageBox.Show("編集が完了できませんでした");
            }
//                Dispatcher.Invoke(new Action(() =>
//                    {}));
        }
예제 #2
0
        void sorttt(object sender, EventArgs e)
        {
            if ((sender as Button).Name.Equals("yuzaname2"))
            {
                if (sortname2 == 0)
                {
                    Application.Current.Properties["sortnamee2"] = 1;
                }
                else if (sortname2 == 1)
                {
                    Application.Current.Properties["sortnamee2"] = 2;
                }
                else if (sortname2 == 2)
                {
                    Application.Current.Properties["sortnamee2"] = 3;
                }
                else
                {
                    Application.Current.Properties["sortnamee2"] = 0;
                }
            }
            else
            {
                if (sortfin2 == 0)
                {
                    Application.Current.Properties["sortfinn2"] = 1;
                }
                else if (sortfin2 == 1)
                {
                    Application.Current.Properties["sortfinn2"] = 2;
                }
                else
                {
                    Application.Current.Properties["sortfinn2"] = 0;
                }
            }

            var nextPage = new UserManagiment();

            NavigationService.Navigate(nextPage);
        }
예제 #3
0
        void manage(object sender, EventArgs e)
        {
            var nextPage = new UserManagiment();

            NavigationService.Navigate(nextPage);
        }
예제 #4
0
        void Registration(object sender, EventArgs e)
        {
            if ((bool)tan.IsChecked == true)
            {
                if (!username.Text.Equals("") && !username_kana.Text.Equals("") && !userid.Text.Equals("") && !pass.Password.Equals("") && !repass.Password.Equals(""))
                {
                    if (pass.Password.ToString().Equals(repass.Password.ToString()))
                    {
                        DBConnect.Connect("kasiihara.db");
                        SQL = "INSERT INTO t_user (user_name,user_name_kana,login_id,password,usertype)VALUES('" + username.Text.ToString() + "','" + username_kana.Text.ToString() + "','" + userid.Text.ToString() + "','" + pass.Password.ToString() + "','担当者')";
                        DBConnect.ExecuteReader(SQL);
                        DBConnect.Dispose();

                        //送信するデータ格納
                        Application.Current.Properties["henshuu"]     = "1";
                        Application.Current.Properties["rename"]      = username.Text;
                        Application.Current.Properties["rename_kana"] = username_kana.Text;
                        Application.Current.Properties["reid"]        = userid.Text;
                        //送信先、遷移先を設定
                        var nextPage = new UserManagiment();
                        NavigationService.Navigate(nextPage);

                        //MessageBox.Show("担当者の登録が完了しました");
                    }
                    else
                    {
                        MessageBox.Show("パスワード入力欄と確認用パスワード入力欄の入力内容が異なります。");
                    }
                }
                else
                {
                    MessageBox.Show("入力項目に誤りがあります。");
                }
            }

            if ((bool)pai.IsChecked == true)
            {
                if (!username.Text.Equals("") && !username_kana.Text.Equals(""))
                {
                    DBConnect.Connect("kasiihara.db");
                    SQL = "INSERT INTO t_user (user_name,user_name_kana,login_id,password,usertype)VALUES('" + username.Text.ToString() + "','" + username_kana.Text.ToString() + "','abc','abc','患者')";
                    DBConnect.ExecuteReader(SQL);
                    SQL = "SELECT * FROM t_user ORDER BY user_id DESC";
                    DBConnect.ExecuteReader(SQL);
                    DBConnect.Reader.Read();
                    SQL = "UPDATE t_user SET login_id = 'kanjya" + DBConnect.Reader[0].ToString() + "',password = '******' WHERE user_id = '" + DBConnect.Reader[0].ToString() + "'";
                    DBConnect.ExecuteReader(SQL);
                    DBConnect.Dispose();

                    //送信するデータ格納
                    Application.Current.Properties["henshuu"]     = "11";
                    Application.Current.Properties["rename"]      = username.Text;
                    Application.Current.Properties["rename_kana"] = username_kana.Text;
                    Application.Current.Properties["reid"]        = userid.Text;
                    //送信先、遷移先を設定
                    var nextPage = new UserManagiment();
                    NavigationService.Navigate(nextPage);

                    //MessageBox.Show("患者の登録が完了しました。");
                }
                else
                {
                    MessageBox.Show("入力項目に誤りがあります。");
                }
            }
        }