예제 #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);