public DataTable GetAllRoleInfo(string rolename) { string sql = string.Empty; if (String.IsNullOrEmpty(rolename)) { sql = "select * from roleinfo"; } else { sql = "select * from roleinfo where rolename like '%" + rolename + "%'"; } return(sqlconn.Query(sql).Tables[0]); }
public DataTable LoadData() { string sql = "select * from tbl_pathValue"; DataTable dt = sqlconn.Query(sql).Tables[0]; return(dt); }
public bool login(string username, string password) { string sql = "select * from sysuser where username=@username and password=@password and status=1"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@username", username), new SqlParameter("@password", password) }; DataSet ds = sqlconn.Query(sql, param); if (ds.Tables[0].Rows.Count > 0) { return(true); } else { return(false); } }
/// <summary> /// 实时信息记录 /// </summary> /// <returns></returns> public DataTable GetInfo() { string sql = @"select top 10 key_process,equipment,productno,createtime from productlog order by createtime desc"; return(sqlconn.Query(sql).Tables[0]); }
public static string Msg(string site, int bytes, int bit) { TempTest sqlconn = new TempTest(); DataTable dt = sqlconn.Query("select * from PLC_Msg where site='" + site + "',byte=" + bytes + ",bit=" + bit + "").Tables[0]; if (dt.Rows.Count > 0) { return(dt.Rows[0]["message"].ToString()); } else { return(string.Empty); } }
public DataTable GetAllDeptInfo(string deptname) { string sql = string.Empty; if (String.IsNullOrEmpty(deptname)) { sql = "select * from department"; } else { sql = "select * from department where deptname like '%" + deptname + "%'"; } return(sqlconn.Query(sql).Tables[0]); }
public DataTable GetEmailConfig() { string sql = "select * from email_config "; return(test.Query(sql).Tables[0]); }
public DataTable GetAllMenuInfo() { string sql = "select menuid,parentid,menuname from menuinfo order by sort"; return(sqlconn.Query(sql).Tables[0]); }