コード例 #1
0
ファイル: Login.cs プロジェクト: pahansoft/Test
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            string hash = string.Empty;
            using (MD5 md5Hash = MD5.Create())
            {
                hash = Util.GetMd5Hash(md5Hash, textBoxPassword.Text.Trim());
            }

            UserProfile matchedProfile = (from c in dc.GetTable<UserProfile>()
                                      where c.userId == textBoxUserName.Text.Trim() && c.Password == hash
                                          select c).SingleOrDefault();
            if (matchedProfile != null)
            {
                this.Hide();

                LoggedClientProfile.UserProfileID = matchedProfile.UserProfileId;
                LoggedClientProfile.UserName = matchedProfile.userId;
                LoggedClientProfile.UserFullName = matchedProfile.FullName;
                LoggedClientProfile.IsManager = matchedProfile.IsManger;
                string machingCode = getMacAddress();

                _registeredPC = (from c in dc.PcRegistrations where c.MachineCode == machingCode select c).SingleOrDefault<PcRegistration>();

                if (_registeredPC == null)
                {
                    frmRegisterPC frmPC = new frmRegisterPC();
                    frmPC.Show();
                }
                else
                {
                    LoggedClientProfile.UserPCID = _registeredPC.PcRegistrationID;
                    LoggedClientProfile.UserPCName = _registeredPC.Description;
                    LoggedClientProfile.LoginSuccess = true;
                    frmMainManu frm = new frmMainManu();
                    frm.Show();

                }

            }
            else
            {
                MessageBox.Show("Invalid User Name Or Password");
                textBoxPassword.Focus();
                textBoxPassword.SelectAll();
                return;
            }
        }
コード例 #2
0
ファイル: Login.cs プロジェクト: pahansoft/Test
        private void LoadDefaults()
        {
            string machingCode = getMacAddress();

            _registeredPC = (from c in dc.PcRegistrations where c.MachineCode == machingCode select c).SingleOrDefault<PcRegistration>();

            if (_registeredPC == null)
            {
                _registeredPC = new PcRegistration();
            }
            else
            {

            }
        }
コード例 #3
0
 partial void UpdatePcRegistration(PcRegistration instance);
コード例 #4
0
 partial void DeletePcRegistration(PcRegistration instance);
コード例 #5
0
 partial void InsertPcRegistration(PcRegistration instance);