Beispiel #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;
                }
            }
        }
        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;
        }