Пример #1
0
        /// ----------------------------------------------------------------------
        /// <summary>
        ///     ログインタイプヘッダ、タグデータ表示 </summary>
        /// <param name="sID">
        ///     ヘッダID</param>
        /// ----------------------------------------------------------------------
        private void getData(int sID)
        {
            // ログインタイプヘッダ
            darwinDataSet.ログインユーザーRow r = dts.ログインユーザー.Single(a => a.ID == sID);

            txtName.Text            = r.ログインユーザー;
            txtPassword.Text        = r.パスワード;
            cmbType.SelectedValue   = r.ログインタイプ;
            comboBox1.SelectedIndex = r.受注案件保守;
            txtMemo.Text            = r.備考;

            // 処理モード
            fMode.Mode = 1;
            fMode.ID   = r.ID;

            // ユーザーアカウント、パスワードの編集は不可とします
            txtName.Enabled = false;

            // パスワード編集チェック
            checkBox1.Visible    = true;
            txtPassword.Enabled  = false;
            txtPassword2.Enabled = false;

            // 削除、取消ボタンの使用を可能とします
            button2.Enabled = true;
            button4.Enabled = true;
        }
Пример #2
0
        /// ----------------------------------------------------------------------
        /// <summary>
        ///     データ削除 </summary>
        /// <param name="sID">
        ///     ヘッダID</param>
        /// ----------------------------------------------------------------------
        private void delData(int sID)
        {
            // ヘッダデータ削除
            darwinDataSet.ログインユーザーRow hr = dts.ログインユーザー.Single(a => a.ID == sID);
            hr.Delete();

            // データベース更新
            uAdp.Update(dts.ログインユーザー);

            // データ読み込み
            uAdp.Fill(dts.ログインユーザー);
        }
Пример #3
0
        /// -------------------------------------------------------------------------
        /// <summary>
        ///     ログインタイプヘッダ、タグデータ登録 </summary>
        /// <param name="sMode">
        ///     処理モード</param>
        /// <param name="sID">
        ///     ヘッダID</param>
        /// -------------------------------------------------------------------------
        private void dataUpdate(int sMode, int sID)
        {
            // 新規登録
            if (sMode == 0)
            {
                // ヘッダ
                darwinDataSet.ログインユーザーRow r = dts.ログインユーザー.NewログインユーザーRow();
                r.ログインユーザー = txtName.Text;
                r.パスワード    = txtPassword.Text;
                r.ログインタイプ  = int.Parse(cmbType.SelectedValue.ToString());
                r.備考       = txtMemo.Text;
                r.受注案件保守   = comboBox1.SelectedIndex;
                r.登録ユーザー   = global.loginUserID;
                r.登録年月日    = DateTime.Now;
                r.更新年月日    = DateTime.Now;
                dts.ログインユーザー.AddログインユーザーRow(r);
            }
            else if (sMode == 1)    // 更新
            {
                // ヘッダ
                darwinDataSet.ログインユーザーRow r = dts.ログインユーザー.Single(a => a.ID == sID);

                if (txtPassword.Visible)
                {
                    r.パスワード = txtPassword.Text;
                }

                r.ログインタイプ = int.Parse(cmbType.SelectedValue.ToString());
                r.備考      = txtMemo.Text;
                r.受注案件保守  = comboBox1.SelectedIndex;
                r.登録ユーザー  = global.loginUserID;
                r.更新年月日   = DateTime.Now;
            }

            // データベース更新
            uAdp.Update(dts.ログインユーザー);

            // データ読み込み
            uAdp.Fill(dts.ログインユーザー);
        }