Esempio n. 1
0
        private void loginAction(Login form, UserInfoBo userInfo)
        {
            using (var context = new MyContext())
            {
                long condtion = Convert.ToInt64(form.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_v2.Settings1.Default.UserId = this.UserId.Text;
                    WordConverter_v2.Settings1.Default.FukusuRiyou = this.fukusuRdo.Checked;
                    WordConverter_v2.Settings1.Default.KojinRiyou = this.kojinRdo.Checked;
                    WordConverter_v2.Settings1.Default.Save();

                    userInfo.kengen = w[0].kengen;
                    userInfo.userId = w[0].user_id;
                    userInfo.empId = w[0].emp_id;
                    userInfo.hotKey = WordConverter_v2.Settings1.Default.HotKey;
                    BaseForm bForm = new BaseForm(userInfo);

                    this.Close();
                    return;
                }
            }
        }
Esempio n. 2
0
        private void loginAction(Login form, UserInfoBo userInfo)
        {
            MyRepository rep = new MyRepository(userInfo.dbType);
            UserMst userMst = rep.FindSankaUserByEmpId(form.UserId.Text.ToIntType());

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

                return;
            }
            WordConverter_v2.Settings1.Default.UserId = this.UserId.Text;
            WordConverter_v2.Settings1.Default.FukusuRiyou = this.fukusuRdo.Checked;
            WordConverter_v2.Settings1.Default.KojinRiyou = this.kojinRdo.Checked;
            WordConverter_v2.Settings1.Default.Save();
            userInfo.kengen = userMst.kengen;
            userInfo.userId = userMst.user_id;
            userInfo.empId = userMst.emp_id;
            userInfo.hotKey = WordConverter_v2.Settings1.Default.HotKey;
            BaseForm bForm = new BaseForm(userInfo);

            this.Close();
            return;
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="uInfo"></param>
        public BaseForm(UserInfoBo uInfo)
        {
            userInfo = uInfo;

            this.InitializeComponent();
            this.notifyIcon1.Visible = true;

            if (BaseForm.userInfo.kengen == Constant.KANRI)
            {
                this.notifyIcon1.ContextMenuStrip = this.管理ユーザーcontextMenuStrip1;
            }
            else if (BaseForm.userInfo.kengen == Constant.IPPAN)
            {
                this.notifyIcon1.ContextMenuStrip = this.一般ユーザーcontextMenuStrip2;
            }

            UnregisterHotKey(this.Handle, HOTKEY_ID);
            this.updateRegisterHotKey(uInfo);
        }
Esempio n. 4
0
 private void startModeSetting(ref UserInfoBo userInfo, Login form)
 {
     CommonFunction common = new CommonFunction();
     if (form.kojinRdo.Checked)
     {
         common.setSqliteDbContextPath(WordConverter_v2.Settings1.Default.SqliteContextString);
         userInfo.startUpMode = (int)StartUpMode.個人;
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         sb.Append("Server=" + WordConverter_v2.Settings1.Default.ServerName);
         sb.Append(";Port=" + WordConverter_v2.Settings1.Default.DbPortNo);
         sb.Append(";User Id=" + WordConverter_v2.Settings1.Default.DbUserId);
         sb.Append(";Password="******";Database=" + WordConverter_v2.Settings1.Default.DbName);
         common.setPostgresDbContext(sb.ToString());
         userInfo.startUpMode = (int)StartUpMode.複数人;
     }
 }
Esempio n. 5
0
        /// <summary>
        /// ログインボタンクリックアクション
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void loginBtn_Click(object sender, EventArgs e)
        {
            bool isNgRequired = false;
            if (String.IsNullOrEmpty(this.UserId.Text))
            {
                errorProvider1.SetError(this.UserId, MessageConst.ERR_001);
                isNgRequired = true;
            }
            if (isNgRequired)
            {
                return;
            }

            UserInfoBo userInfo = new UserInfoBo();
            this.startModeSetting(ref userInfo, this);

            try
            {
                this.loginAction(this, userInfo);
                return;

            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
Esempio n. 6
0
 private void startModeSetting(ref UserInfoBo userInfo, Login form)
 {
     CommonFunction common = new CommonFunction();
     if (form.kojinRdo.Checked)
     {
         userInfo.startUpMode = (int)StartUpMode.個人;
         userInfo.dbType = Constant.SQLITE_CONNECT;
     }
     else
     {
         userInfo.startUpMode = (int)StartUpMode.複数人;
         userInfo.dbType = Constant.POSTGRES_CONNECT;
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="uInfo"></param>
        private void updateRegisterHotKey(UserInfoBo uInfo)
        {
            String[] hotKey = uInfo.hotKey.ToString().Split('+');
            int modKey = MOD_CONTROL;
            int regKey = (int)Keys.E;
            switch (hotKey[0].Trim())
            {
                case "Ctrl":
                    modKey = MOD_CONTROL;
                    break;
                case "Shift":
                    modKey = MOD_SHIFT;
                    break;
                case "Alt":
                    modKey = MOD_ALT;
                    break;
                default:
                    break;
            }

            if (hotKey.Length > 1)
            {
                foreach (int i in Enum.GetValues(typeof(Keys)))
                {
                    if (((Keys)i).ToString() == hotKey[1].Trim())
                    {
                        regKey = i;
                        break;
                    }
                }
            }

            RegisterHotKey(this.Handle, HOTKEY_ID, modKey, regKey);
        }
Esempio n. 8
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;
            }

            if (this.camelCaseCheckBox.Checked == false
                || this.pascalCaseCheckBox.Checked == false
                || this.snakeCaseCheckBox.Checked == false)
            {
                errorProvider1.SetError(this.groupBox1, MessageConst.ERR_009);

                return;
            }

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

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

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