public bool Check1(QuanLyObj qlObj) { DataTable dt = new DataTable(); cmd.CommandText = "Select Count(*) From QUANLY where taikhoan='admin'and matkhau='" + qlObj.MatKhau + "'"; cmd.CommandType = CommandType.Text; cmd.Connection = con.Connection; try { SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { return(true); } else { return(false); } } catch (Exception ex) { string mex = ex.Message; cmd.Dispose(); con.CloseConn(); } return(false); }
public bool UpdDataTenAdmin(QuanLyObj qlObj) { cmd.CommandText = "Update QUANLY set ten = N'" + qlObj.Ten + "' Where taikhoan = 'admin'"; cmd.CommandType = CommandType.Text; cmd.Connection = con.Connection; try { con.OpenConn(); cmd.ExecuteNonQuery(); return(true); } catch (Exception ex) { string mex = ex.Message; cmd.Dispose(); con.CloseConn(); } return(false); }
public bool AddDataQL(QuanLyObj qlObj) { cmd.CommandText = "Insert into QUANLY values ('" + qlObj.ID + "','" + qlObj.Taikhoan + "','" + qlObj.MatKhau + "',N'" + qlObj.Ten + "')"; cmd.CommandType = CommandType.Text; cmd.Connection = con.Connection; try { con.OpenConn(); cmd.ExecuteNonQuery(); con.CloseConn(); } catch (Exception ex) { string mex = ex.Message; cmd.Dispose(); con.CloseConn(); } return(false); }
void ganDulieuQL(QuanLyObj qlObj) { qlObj.Taikhoan = txtTaiKhoan.Text.Trim(); qlObj.MatKhau = toMD5(txtMatKhau.Text);// txtMatKhau.Text.Trim(); }
public bool check1(QuanLyObj qlObj) { return(qlMod.Check1(qlObj)); }
public bool updDateTenAdmin(QuanLyObj qlObj) { return(qlMod.UpdDataTenAdmin(qlObj)); }
public bool updDate(QuanLyObj qlObj) { return(qlMod.UpdData(qlObj)); }
public bool addDataQL(QuanLyObj qlObj) { return(qlMod.AddDataQL(qlObj)); }