Example #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;
                }
            }
        }
Example #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;
        }
Example #3
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.複数人;
     }
 }
Example #4
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;
     }
 }