public void BindData() { #region //if (!Context.User.Identity.IsAuthenticated) //{ // return; //} //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name); //if (user.HasPermissionID(PermId_Modify)) //{ // gridView.Columns[6].Visible = true; //} //if (user.HasPermissionID(PermId_Delete)) //{ // gridView.Columns[7].Visible = true; //} #endregion DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); if (txtKeyword.Text.Trim() != "") { #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称 //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim()); } ds = bll.GetList(strWhere.ToString()); gridView.DataSource = ds; gridView.DataBind(); }
private void txtmm_KeyDown(object sender, KeyEventArgs e) { if (Keys.Enter == e.KeyCode) { string zh = ""; string mm = ""; string lab_name = txtzh.Text; string lab_pass_word = txtmm.Text; Maticsoft.BLL.username user = new Maticsoft.BLL.username(); DataSet ds = user.GetList(string.Format(" user = '******' ", lab_name)); DataTable dt = ds.Tables[0]; string user_name = dt.Rows[0]["user"].ToString(); string password = dt.Rows[0]["password"].ToString(); global.power = dt.Rows[0]["power"].ToString(); //MessageBox.Show(" " + password + " aa "); //MessageBox.Show(dt.Rows.Count + " :count " + user_name + " : username " + password + " :password " + lab_name + " :lab_name " + lab_pass_word + " :mm "); if (user_name == lab_name && password == lab_pass_word) { MainFrom mf = new MainFrom(); mf.Show(); } else { //MessageBox.Show(" " + password + " === " + mm); MessageBox.Show("密码或账号不正确"); return; } } }
private void query_bt_Click(object sender, EventArgs e) { if (username_tb.Text != "" && time_dtp.Text == "") { Maticsoft.BLL.username use = new Maticsoft.BLL.username(); string aa = string.Format("user = '******'", username_tb.Text); DataSet ds = use.GetList(aa); users_gc.DataSource = ds.Tables[0]; } if (username_tb.Text == "" && time_dtp.Text != "") { Maticsoft.BLL.username use = new Maticsoft.BLL.username(); string aa = string.Format("addtime = '{0}'", time_dtp.Text); DataSet ds = use.GetList(aa); users_gc.DataSource = ds.Tables[0]; } if (username_tb.Text != "" && time_dtp.Text != "") { Maticsoft.BLL.username use = new Maticsoft.BLL.username(); string aa = string.Format("addtime = '{0}'and user='******'", time_dtp.Text, username_tb.Text); DataSet ds = use.GetList(aa); users_gc.DataSource = ds.Tables[0]; } if (username_tb.Text == "" && time_dtp.Text == "") { Maticsoft.BLL.username use = new Maticsoft.BLL.username(); DataSet ds = use.GetAllList(); users_gc.DataSource = ds.Tables[0]; } }
private void pictureBox2_Click(object sender, EventArgs e) { string zh = ""; string mm = ""; string lab_name = txtzh.Text; string lab_pass_word = txtmm.Text; Maticsoft.BLL.username user = new Maticsoft.BLL.username(); DataSet ds = user.GetList(string.Format(" user = '******' ", lab_name)); DataTable dt = ds.Tables[0]; string user_name = dt.Rows[0]["user"].ToString(); string password = dt.Rows[0]["password"].ToString(); global.power = dt.Rows[0]["power"].ToString(); //MessageBox.Show(" " + password + " aa "); //MessageBox.Show(dt.Rows.Count + " :count " + user_name + " : username " + password + " :password " + lab_name + " :lab_name " + lab_pass_word + " :mm "); if (user_name == lab_name && password == lab_pass_word) { MainFrom mf = new MainFrom(); mf.Show(); } else { //MessageBox.Show(" " + password + " === " + mm); MessageBox.Show("密码或账号不正确"); return; } /* * Maticsoft.BLL.username use = new Maticsoft.BLL.username(); * DataSet ds = use.GetAllList(); * for (int i = 0; i < ds.Tables[0].Rows.Count; i++) * { * zh = ds.Tables[0].Rows[i]["user"].ToString(); * mm = ds.Tables[0].Rows[i]["password"].ToString(); * * * if (txtzh.Text == zh && txtmm.Text == mm) * { * MainFrom mf = new MainFrom(); * mf.Show(); * break; * } * } * if(txtzh.Text != zh || txtmm.Text != mm) * { * MessageBox.Show("密码或账号不正确"); * return; * } */ //MainFrom mf = new MainFrom(); //mf.Show(); }