Beispiel #1
0
        /// <summary>
        /// ログインボタンクリックアクション
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void loginBtn_Click(object sender, EventArgs e)
        {
            CommonFunction common = new CommonFunction();
            common.setDbPath(this.dataSourcePath.Text);

            using (var context = new MyContext())
            {
                long condtion = Convert.ToInt64(this.UserId.Text);
                var w = context.UserMst.Where(x => x.EMP_ID == condtion && x.SANKA_KAHI == 0).ToArray();

                if (w.Count() == 0)
                {
                    MessageBox.Show(
                        MessageConst.ERR_007,
                        System.Windows.Forms.Application.ProductName,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Warning);

                    return;
                }
                if (w.Count() == 1)
                {
                    WordConverter.Settings1.Default.UserId = this.UserId.Text;
                    WordConverter.Settings1.Default.DataSource = this.dataSourcePath.Text;
                    WordConverter.Settings1.Default.Save();

                    UserInfoBo userInfo = new UserInfoBo();
                    userInfo.kengen = w[0].KENGEN;
                    userInfo.userId = w[0].USER_ID;
                    userInfo.hotKey = WordConverter.Settings1.Default.HotKey;
                    BaseForm form = new BaseForm(userInfo);

                    this.Close();
                    return;
                }
            }
        }
Beispiel #2
0
        static void Main()
        {
            //Mutexクラスの作成
            _mutex = new System.Threading.Mutex(false, "WordConverter");
            //ミューテックスの所有権を要求する
            if (_mutex.WaitOne(0, false) == false)
            {
                //すでに起動していると判断して終了
                MessageBox.Show("WordConverterの多重起動はできません。");
                return;
            }

            Program.ExecuteDDL();
            BaseForm baseForm = new BaseForm();
            Application.Run();
        }
Beispiel #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void regist_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.hotKey.Text))
            {
                MessageBox.Show(
                "ホットキーは必須です。",
                "入力エラー",
                MessageBoxButtons.OK,
                MessageBoxIcon.Warning);

                return;
            }

            if (!this.hotKey.Text.Contains("Ctrl")
                && !this.hotKey.Text.Contains("Shift")
                && !this.hotKey.Text.Contains("Alt"))
            {
                MessageBox.Show(
                "ホットキーには「修飾キー」を含める必要があります。",
                "入力エラー",
                MessageBoxButtons.OK,
                MessageBoxIcon.Warning);

                return;
            }

            if (this.hotKey.Text.Equals("Ctrl")
                || this.hotKey.Text.Equals("Shift")
                || this.hotKey.Text.Equals("Alt"))
            {
                MessageBox.Show(
                "ホットキーは「修飾キー」+「一般キー」で設定してください。",
                "入力エラー",
                MessageBoxButtons.OK,
                MessageBoxIcon.Warning);

                return;
            }

            WordConverter.Settings1.Default.Pascal = this.pascalCaseCheckBox.Checked;
            WordConverter.Settings1.Default.Camel = this.camelCaseCheckBox.Checked;
            WordConverter.Settings1.Default.Snake = this.snakeCaseCheckBox.Checked;
            WordConverter.Settings1.Default.DispNumber = this.getDisplayNumber(this);
            WordConverter.Settings1.Default.HotKey = this.hotKey.Text;
            WordConverter.Settings1.Default.Save();

            UserInfoBo userInfo = new UserInfoBo();
            userInfo.hotKey = WordConverter.Settings1.Default.HotKey;
            userInfo.dispNumber = WordConverter.Settings1.Default.DispNumber;
            BaseForm form = new BaseForm(userInfo);

            MessageBox.Show("設定を登録しました。");
        }