文件名称:企业客户资源管理系统
文件大小:3.1MB
文件格式:RAR
更新时间:2010-07-14 06:20:07
C#,管理信息系统,源码,毕业设计
企业客户资源管理系统 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace CRM { public partial class frmLogin : Form { public static string M_str_name;//记录登录用户名字 public static string M_str_pwd;//记录登录用户密码 public static string M_str_right;//记录登录用户的权限 CRM.BaseClass.BaseOperate boperate = new CRM.BaseClass.BaseOperate(); CRM.BaseClass.OperateAndValidate opAndvalidate = new CRM.BaseClass.OperateAndValidate(); public frmLogin() { InitializeComponent(); } private void frmLogin_Load(object sender, EventArgs e) { opAndvalidate.cboxBind(\"select UserName from tb_User\", \"tb_User\", \"UserName\", cboxUName); } private void cboxUName_SelectedIndexChanged(object sender, EventArgs e) { SqlDataReader sqlread = boperate.getread(\"select UserName,UserRight from tb_User where UserName=\'\" + cboxUName.Text + \"\'\"); if (sqlread.Read()) { labURight.Text = sqlread[\"UserRight\"].ToString(); M_str_right = labURight.Text; } sqlread.Close(); } private void btnLogin_Click(object sender, EventArgs e) { SqlDataReader sqlread=boperate.getread(\"select UserName,UserPwd from tb_User where UserName=\'\"+cboxUName.Text.Trim()+\"\' and UserPwd=\'\"+txtPwd.Text.Trim()+\"\'\"); sqlread.Read(); if (sqlread.HasRows) { M_str_name = cboxUName.Text; M_str_pwd = txtPwd.Text.Trim(); frmMain fmain = new frmMain(); this.Hide(); fmain.Show(); } else { MessageBox.Show(\"用户名或密码错误!\", \"提示\", MessageBoxButtons.OK, MessageBoxIcon.Information); txtPwd.Text = \"\"; cboxUName.Focus(); } sqlread.Close(); } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); } private void frmLogin_FormClosing(object sender, FormClosingEventArgs e) { Application.Exit(); } } }