public Loginfrm(UserDetail userDetail) { InitializeComponent(); //ExecutiveName = userDetail.UserId; UserDetail = userDetail; IsLogedIn = false; }
private void Form1_Load(object sender, EventArgs e) { Loginfrm frm = new Loginfrm(new UserDetail()); frm.ShowDialog(); if (!frm.IsLogedIn) { this.Close(); return; } UserDetail = frm.UserDetail; _moduleList.AddRange(UserDetail.Modules.Split(',')); }
private void txtPassword_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter) return; if (string.IsNullOrEmpty(txtExecutiveName.Text)) { MessageBox.Show("Please Enter Executive Name", "Message", MessageBoxButtons.OK); return; } if (UserDetail.Id <= 0) { var uniDb = new UniDBDataContext(); UserDetail = uniDb.UserDetails.SingleOrDefault(x => x.UserId == txtExecutiveName.Text); } if (UserDetail == null) { MessageBox.Show("You have enter wrong User Name", "Message", MessageBoxButtons.OK); return; } if (UserDetail.Password.ToUpper() == txtPassword.Text.ToUpper()) { IsLogedIn = true; this.Close(); } else { MessageBox.Show("You have enter wrong password ", "Message", MessageBoxButtons.OK); } //if (txtPassword.Text.ToUpper() == ConfigurationSettings.AppSettings["password"].ToUpper()) //{ // ExecutiveName = txtExecutiveName.Text; // IsLogedIn = true; // this.Close(); //} //else //{ // MessageBox.Show("You have enter wrong password ", "Message", MessageBoxButtons.OK); //} }
partial void DeleteUserDetail(UserDetail instance);
partial void UpdateUserDetail(UserDetail instance);
partial void InsertUserDetail(UserDetail instance);