private void fToolStripMenuItem_Click(object sender, EventArgs e) { F_Login F = new F_Login(); F.Show(); Hide(); }
/// <summary> /// Окно авторизации /// </summary> /// <param name="usingAccess">Соеденение с Access для проверки Логина/Пароля</param> public AuthorizationWindow(UsingDataView UserList) { InitializeComponent(); F_Login.Focus(); this.UserList = UserList; }
private void Btn_Précedent_Click(object sender, EventArgs e) { F_Login F = new F_Login(); F.Show(); Hide(); }
/// <summary> /// Проверка полей на пустоту и попытка авторизации /// </summary> private void AttemptEnter() { if (F_Login.Text.Length > 4) { CheckNewUser(F_Login.Text); } if (F_Login.Text.Length < 4 && F_Password.Password.Length < 4) { MessageBox.Show("Введите пользователя и пароль"); return; } else if (F_Login.Text.Length < 4) { MessageBox.Show("Введите пользователя"); return; } else if (F_Password.Password.Length < 4) { MessageBox.Show("Введите пароль"); return; } if (CheckLogPas()) { this.DialogResult = true; } else { F_Password.Clear(); F_Login.Focus(); F_Login.SelectAll(); } }
/// <summary> /// Окно авторизации /// </summary> /// <param name="usingAccess">Соеденение с Access для проверки Логина/Пароля</param> public LoginPassword(UsingAccess usingAccess) { System.Console.WriteLine("Запуск окна авторизации"); InitializeComponent(); UsAc = usingAccess; F_Login.Focus(); }
public Form1() { InitializeComponent(); F_Login f_Login = new F_Login(this); f_Login.ShowDialog(); }
public bool getLogin(F_Login formModel) { string sql = "SELECT * FROM personal WHERE personal_username = '******' AND personal_password = '******' "; DataTable dataTable = classDB.selectDataTable(sql); if (dataTable.Rows.Count == 1) { setPersonalLogin(dataTable.Rows[0]); return(true); } return(false); }
public ActionResult SignIn(LoginModel model, bool isLoginAdmin = false) { var F_login = new F_Login(); if (ModelState.IsValid) { if (F_login.login(model.Username, model.Password)) { var password = Flight.Models.Functions.F_Login.EncMD5(model.Password); var temp = new F_Login().DS_Admin.Where(x => x.UserName == model.Username && x.Password == password).SingleOrDefault(); var UserSession = new UserLogin(); UserSession.UserName = model.Username; UserSession.UserID = temp.MaThanhVien; UserSession.GroupID = temp.GroupID; var listCredential = F_login.GetListCredential(model.Username); Session.Add(CommonConstants.SESSION_CREDENTIAL, listCredential); Session.Add(CommonSession.USER_SESSION, UserSession); if (UserSession.GroupID == "MEMBER") { return(Json(new { msg = "M" })); } else if (UserSession.GroupID == "ADMIN") { return(Json(new { msg = "A" })); } } else { return(Json(new { msg = "F" })); } } return(View("Login")); }
public ActionResult isLogin(F_Login formModel) { M_Login model = new M_Login(); if (formModel.requestLogin == "isLogin") { if (model.getLogin(formModel)) { return(Json(SystemClass.returnResultJsonSuccess())); } else { return(Json(SystemClass.returnResultJsonFailure())); } } else { return(Json(SystemClass.returnResultJsonFailure())); } }
/// <summary> /// Проверка полей на пустоту и попытка авторизации /// </summary> private void AttemptEnter() { if (F_Login.Text == "") { F_Login.Focus(); F_Login.SelectAll(); } else if (F_Password.Password == "") { F_Password.Focus(); F_Password.SelectAll(); } if (CheckLogPas()) { this.DialogResult = true; } else { F_Password.Clear(); F_Login.Focus(); F_Login.SelectAll(); } }
public static string User_Name = ""; //存储用户名 #endregion #region 窗体的调用 /// <summary> /// 窗体的调用. /// </summary> /// <param name="FrmName">调用窗体的Text属性值</param> /// <param name="n">标识</param> public void Show_Form(string FrmName, int n) { if (n == 1) { if (FrmName == "人事档案管理") //判断当前要打开的窗体 { PerForm.F_ManFile FrmManFile = new PWMS.PerForm.F_ManFile(); FrmManFile.Text = "人事档案管理"; //设置窗体名称 FrmManFile.ShowDialog(); //显示窗体 FrmManFile.Dispose(); } if (FrmName == "人事资料查询") { PerForm.F_Find FrmFind = new PWMS.PerForm.F_Find(); FrmFind.Text = "人事资料查询"; FrmFind.ShowDialog(); FrmFind.Dispose(); } if (FrmName == "人事资料统计") { PerForm.F_Stat FrmStat = new PWMS.PerForm.F_Stat(); FrmStat.Text = "人事资料统计"; FrmStat.ShowDialog(); FrmStat.Dispose(); } if (FrmName == "员工生日提示") { InfoAddForm.F_ClewSet FrmClewSet = new PWMS.InfoAddForm.F_ClewSet(); FrmClewSet.Text = "员工生日提示"; //设置窗体名称 FrmClewSet.Tag = 1; //设置窗体的Tag属性,用于在打开窗体时判断窗体的显示类形 FrmClewSet.ShowDialog(); //显示窗体 FrmClewSet.Dispose(); } if (FrmName == "员工合同提示") { InfoAddForm.F_ClewSet FrmClewSet = new PWMS.InfoAddForm.F_ClewSet(); FrmClewSet.Text = "员工合同提示"; FrmClewSet.Tag = 2; FrmClewSet.ShowDialog(); FrmClewSet.Dispose(); } if (FrmName == "日常记事") { PerForm.F_WordPad FrmWordPad = new PWMS.PerForm.F_WordPad(); FrmWordPad.Text = "日常记事"; FrmWordPad.ShowDialog(); FrmWordPad.Dispose(); } if (FrmName == "通讯录") { PerForm.F_AddressList FrmAddressList = new PWMS.PerForm.F_AddressList(); FrmAddressList.Text = "通讯录"; FrmAddressList.ShowDialog(); FrmAddressList.Dispose(); } if (FrmName == "备份/还原数据库") { PerForm.F_HaveBack FrmHaveBack = new PWMS.PerForm.F_HaveBack(); FrmHaveBack.Text = "备份/还原数据库"; FrmHaveBack.ShowDialog(); FrmHaveBack.Dispose(); } if (FrmName == "清空数据库") { PerForm.F_ClearData FrmClearData = new PWMS.PerForm.F_ClearData(); FrmClearData.Text = "清空数据库"; FrmClearData.ShowDialog(); FrmClearData.Dispose(); } if (FrmName == "重新登录") { F_Login FrmLogin = new F_Login(); FrmLogin.Tag = 2; FrmLogin.ShowDialog(); FrmLogin.Dispose(); } if (FrmName == "用户设置") { PerForm.F_User FrmUser = new PWMS.PerForm.F_User(); FrmUser.Text = "用户设置"; FrmUser.ShowDialog(); FrmUser.Dispose(); } if (FrmName == "计算器") { System.Diagnostics.Process.Start("calc.exe"); } if (FrmName == "记事本") { System.Diagnostics.Process.Start("notepad.exe"); } if (FrmName == "系统帮助") { System.Diagnostics.Process.Start("readme.doc"); } } if (n == 2) { String FrmStr = ""; //记录窗体名称 if (FrmName == "民族类别设置") //判断要打开的窗体 { DataClass.MyMeans.Mean_SQL = "select * from tb_Folk"; //SQL语句 DataClass.MyMeans.Mean_Table = "tb_Folk"; //表名 DataClass.MyMeans.Mean_Field = "FolkName"; //添加、修改数据的字段名 FrmStr = FrmName; } if (FrmName == "职工类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_EmployeeGenre"; DataClass.MyMeans.Mean_Table = "tb_EmployeeGenre"; DataClass.MyMeans.Mean_Field = "EmployeeName"; FrmStr = FrmName; } if (FrmName == "文化程度设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_Kultur"; DataClass.MyMeans.Mean_Table = "tb_Kultur"; DataClass.MyMeans.Mean_Field = "KulturName"; FrmStr = FrmName; } if (FrmName == "政治面貌设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_Visage"; DataClass.MyMeans.Mean_Table = "tb_Visage"; DataClass.MyMeans.Mean_Field = "VisageName"; FrmStr = FrmName; } if (FrmName == "部门类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_Branch"; DataClass.MyMeans.Mean_Table = "tb_Branch"; DataClass.MyMeans.Mean_Field = "BranchName"; FrmStr = FrmName; } if (FrmName == "工资类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_Laborage"; DataClass.MyMeans.Mean_Table = "tb_Laborage"; DataClass.MyMeans.Mean_Field = "LaborageName"; FrmStr = FrmName; } if (FrmName == "职务类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_Business"; DataClass.MyMeans.Mean_Table = "tb_Business"; DataClass.MyMeans.Mean_Field = "BusinessName"; FrmStr = FrmName; } if (FrmName == "职称类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_Duthcall"; DataClass.MyMeans.Mean_Table = "tb_Duthcall"; DataClass.MyMeans.Mean_Field = "DuthcallName"; FrmStr = FrmName; } if (FrmName == "奖惩类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_RPKind"; DataClass.MyMeans.Mean_Table = "tb_RPKind"; DataClass.MyMeans.Mean_Field = "RPKind"; FrmStr = FrmName; } if (FrmName == "记事本类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_WordPad"; DataClass.MyMeans.Mean_Table = "tb_WordPad"; DataClass.MyMeans.Mean_Field = "WordPad"; FrmStr = FrmName; } InfoAddForm.F_Basic FrmBasic = new PWMS.InfoAddForm.F_Basic(); FrmBasic.Text = FrmStr; //设置窗体名称 FrmBasic.ShowDialog(); //显示调用的窗体 FrmBasic.Dispose(); } }
//F_Main #region 窗体的调用 /// <summary> /// 窗体的调用. /// </summary> /// <param name="FrmName">调用窗体的Text属性值</param> /// <param name="n">标识</param> public void Show_Form(string FrmName, int n) { if (n == 1) { if (FrmName == "商标档案管理") //判断当前要打开的窗体 { PerForm.F_TMFileMana FrmManFile = new TMPT.PerForm.F_TMFileMana(); FrmManFile.Text = "商标档案管理"; //设置窗体名称 FrmManFile.ShowDialog(); //显示窗体 FrmManFile.Dispose(); } if (FrmName == "商标资料查询") { PerForm.F_TMSearch FrmFind = new TMPT.PerForm.F_TMSearch(); FrmFind.Text = "商标资料查询"; FrmFind.ShowDialog(); FrmFind.Dispose(); } if (FrmName == "商标统计信息") { PerForm.F_TMStat FrmStat = new TMPT.PerForm.F_TMStat(); FrmStat.Text = "商标统计信息"; FrmStat.ShowDialog(); FrmStat.Dispose(); } if (FrmName == "专利档案管理") //判断当前要打开的窗体 { PerForm.F_PTFileMana FrmManFile = new TMPT.PerForm.F_PTFileMana(); FrmManFile.Text = "专利档案管理"; //设置窗体名称 FrmManFile.ShowDialog(); //显示窗体 FrmManFile.Dispose(); } if (FrmName == "专利资料查询") { PerForm.F_TMSearch FrmFind = new TMPT.PerForm.F_TMSearch(); FrmFind.Text = "专利资料查询"; FrmFind.ShowDialog(); FrmFind.Dispose(); } if (FrmName == "专利统计信息") { PerForm.F_TMStat FrmStat = new TMPT.PerForm.F_TMStat(); FrmStat.Text = "专利统计信息"; FrmStat.ShowDialog(); FrmStat.Dispose(); } if (FrmName == "拜访提示") { InfoAddForm.F_ClewSet FrmClewSet = new TMPT.InfoAddForm.F_ClewSet(); FrmClewSet.Text = "拜访提示"; //设置窗体名称 FrmClewSet.Tag = 1; //设置窗体的Tag属性,用于在打开窗体时判断窗体的显示类形 FrmClewSet.ShowDialog(); //显示窗体 FrmClewSet.Dispose(); } if (FrmName == "来访提示") { InfoAddForm.F_ClewSet FrmClewSet = new TMPT.InfoAddForm.F_ClewSet(); FrmClewSet.Text = "来访提示"; FrmClewSet.Tag = 2; FrmClewSet.ShowDialog(); FrmClewSet.Dispose(); } if (FrmName == "日常记事本") { PerForm.F_WordPad FrmWordPad = new TMPT.PerForm.F_WordPad(); FrmWordPad.Text = "日常记事本"; FrmWordPad.ShowDialog(); FrmWordPad.Dispose(); } if (FrmName == "通讯录管理") { PerForm.F_AddressList FrmAddressList = new TMPT.PerForm.F_AddressList(); FrmAddressList.Text = "通讯录管理"; FrmAddressList.ShowDialog(); FrmAddressList.Dispose(); } if (FrmName == "备份还原") { PerForm.F_HaveBack FrmHaveBack = new TMPT.PerForm.F_HaveBack(); FrmHaveBack.Text = "备份还原"; FrmHaveBack.ShowDialog(); FrmHaveBack.Dispose(); } if (FrmName == "清空数据库") { PerForm.F_ClearData FrmClearData = new TMPT.PerForm.F_ClearData(); FrmClearData.Text = "清空数据库"; FrmClearData.ShowDialog(); FrmClearData.Dispose(); } if (FrmName == "重新登录") { F_Login FrmLogin = new F_Login(); FrmLogin.Tag = 2; FrmLogin.ShowDialog(); FrmLogin.Dispose(); } if (FrmName == "用户管理") { PerForm.F_User FrmUser = new TMPT.PerForm.F_User(); FrmUser.Text = "用户管理"; FrmUser.ShowDialog(); FrmUser.Dispose(); } if (FrmName == "计算器") { System.Diagnostics.Process.Start("calc.exe"); } if (FrmName == "记事本") { System.Diagnostics.Process.Start("notepad.exe"); } if (FrmName == "系统帮助") { // System.Diagnostics.Process.Start("readme.doc"); } } if (n == 2) { String FrmStr = ""; //记录窗体名称 if (FrmName == "商标组成设置") //判断要打开的窗体 { DataClass.MyMeans.Mean_SQL = "select * from tb_商标组成"; //SQL语句 DataClass.MyMeans.Mean_Table = "tb_商标组成"; //表名 DataClass.MyMeans.Mean_Field = "商标组成"; //添加、修改数据的字段名 FrmStr = FrmName; } if (FrmName == "商标状态设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_商标状态"; DataClass.MyMeans.Mean_Table = "tb_商标状态"; DataClass.MyMeans.Mean_Field = "商标状态"; FrmStr = FrmName; } if (FrmName == "商标类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_商标类别"; DataClass.MyMeans.Mean_Table = "tb_商标类别"; DataClass.MyMeans.Mean_Field = "商标类别"; FrmStr = FrmName; } if (FrmName == "商标申请地设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_商标申请地"; DataClass.MyMeans.Mean_Table = "tb_商标申请地"; DataClass.MyMeans.Mean_Field = "商标申请地"; FrmStr = FrmName; } if (FrmName == "商标申请方设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_商标申请方"; DataClass.MyMeans.Mean_Table = "tb_商标申请方"; DataClass.MyMeans.Mean_Field = "商标申请方"; FrmStr = FrmName; } if (FrmName == "专利组成设置") //判断要打开的窗体 { DataClass.MyMeans.Mean_SQL = "select * from tb_专利组成"; //SQL语句 DataClass.MyMeans.Mean_Table = "tb_专利组成"; //表名 DataClass.MyMeans.Mean_Field = "专利组成"; //添加、修改数据的字段名 FrmStr = FrmName; } if (FrmName == "专利状态设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_专利状态"; DataClass.MyMeans.Mean_Table = "tb_专利状态"; DataClass.MyMeans.Mean_Field = "专利状态"; FrmStr = FrmName; } if (FrmName == "专利类别设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_专利类别"; DataClass.MyMeans.Mean_Table = "tb_专利类别"; DataClass.MyMeans.Mean_Field = "专利类别"; FrmStr = FrmName; } if (FrmName == "专利归属地设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_专利申请地"; DataClass.MyMeans.Mean_Table = "tb_专利申请地"; DataClass.MyMeans.Mean_Field = "专利申请地"; FrmStr = FrmName; } if (FrmName == "专利归属方设置") { DataClass.MyMeans.Mean_SQL = "select * from tb_专利申请方"; DataClass.MyMeans.Mean_Table = "tb_专利申请方"; DataClass.MyMeans.Mean_Field = "专利申请方"; FrmStr = FrmName; } //if (FrmName == "记事本类别设置") //{ // DataClass.MyMeans.Mean_SQL = "select * from tb_WordPad"; // DataClass.MyMeans.Mean_Table = "tb_WordPad"; // DataClass.MyMeans.Mean_Field = "WordPad"; // FrmStr = FrmName; //} InfoAddForm.F_Basic FrmBasic = new TMPT.InfoAddForm.F_Basic(); FrmBasic.Text = FrmStr; //设置窗体名称 FrmBasic.ShowDialog(); //显示调用的窗体 FrmBasic.Dispose(); } }
private void btn_login_Click(object sender, EventArgs e) { F_Login f_Login = new F_Login(this); f_Login.ShowDialog(); }
public void Show_Form(string FrmName, int n) { if (n == 1) { if (FrmName == "人事档案管理") //判断当前要打开的窗体 { PerForm.F_ManFile FrmManFile = new PWMS.PerForm.F_ManFile(); FrmManFile.Text = "人事档案管理"; //设置窗体名称 FrmManFile.ShowDialog(); //显示窗体 FrmManFile.Dispose(); } if (FrmName == "人事资料查询") { PerForm.F_Find FrmFind = new PWMS.PerForm.F_Find(); FrmFind.Text = "人事资料查询"; FrmFind.ShowDialog(); FrmFind.Dispose(); } if (FrmName == "人事资料统计") { PerForm.F_Stat FrmStat = new PWMS.PerForm.F_Stat(); FrmStat.Text = "人事资料统计"; FrmStat.ShowDialog(); FrmStat.Dispose(); } //if (FrmName == "员工生日提示") //{ // InfoAddForm.F_ClewSet FrmClewSet = new PWMS.InfoAddForm.F_ClewSet(); // FrmClewSet.Text = "员工生日提示"; //设置窗体名称 // FrmClewSet.Tag = 1; //设置窗体的Tag属性,用于在打开窗体时判断窗体的显示类形 // FrmClewSet.ShowDialog(); //显示窗体 // FrmClewSet.Dispose(); //} //if (FrmName == "员工合同提示") //{ // InfoAddForm.F_ClewSet FrmClewSet = new PWMS.InfoAddForm.F_ClewSet(); // FrmClewSet.Text = "员工合同提示"; // FrmClewSet.Tag = 2; // FrmClewSet.ShowDialog(); // FrmClewSet.Dispose(); //} if (FrmName == "日常记事") { PerForm.F_WordPad FrmWordPad = new PWMS.PerForm.F_WordPad(); FrmWordPad.Text = "日常记事"; FrmWordPad.ShowDialog(); FrmWordPad.Dispose(); } if (FrmName == "通讯录") { PerForm.F_AddressList FrmAddressList = new PWMS.PerForm.F_AddressList(); FrmAddressList.Text = "通讯录"; FrmAddressList.ShowDialog(); FrmAddressList.Dispose(); } if (FrmName == "备份/还原数据库") { PerForm.F_HaveBack FrmHaveBack = new PWMS.PerForm.F_HaveBack(); FrmHaveBack.Text = "备份/还原数据库"; FrmHaveBack.ShowDialog(); FrmHaveBack.Dispose(); } if (FrmName == "清空数据库") { PerForm.F_ClearData FrmClearData = new PWMS.PerForm.F_ClearData(); FrmClearData.Text = "清空数据库"; FrmClearData.ShowDialog(); FrmClearData.Dispose(); } if (FrmName == "重新登录") { F_Login FrmLogin = new F_Login(); FrmLogin.Tag = 2; FrmLogin.ShowDialog(); FrmLogin.Dispose(); } if (FrmName == "用户设置") { PerForm.F_User FrmUser = new PWMS.PerForm.F_User(); FrmUser.Text = "用户设置"; FrmUser.ShowDialog(); FrmUser.Dispose(); } if (FrmName == "计算器") { System.Diagnostics.Process.Start("calc.exe"); } if (FrmName == "记事本") { System.Diagnostics.Process.Start("notepad.exe"); } if (FrmName == "系统帮助") { System.Diagnostics.Process.Start("readme.doc"); } } if (n == 2) { String FrmStr = ""; //记录窗体名称 if (FrmName == "民族类别设置") //判断要打开的窗体 { DataClass.MyMeans.Mean_SQL = "select * from tb_Folk"; //SQL语句 DataClass.MyMeans.Mean_Table = "tb_Folk"; //表名 DataClass.MyMeans.Mean_Field = "FolkName"; //添加、修改数据的字段名 FrmStr = FrmName; } InfoAddForm.F_Basic FrmBasic = new PWMS.InfoAddForm.F_Basic(); FrmBasic.Text = FrmStr; //设置窗体名称 FrmBasic.ShowDialog(); //显示调用的窗体 FrmBasic.Dispose(); } }