public static DataSet SearchJobs(string skills,int countryid,int stateid,string city) { string[] arr = skills.Split(' '); DataSet ds = new DataSet(); DataSet dsTemp = new DataSet(); bool flag = false; DBAccess db = new DBAccess(); foreach (string s in arr) { db.AddParameter("@sSkill", s); if (countryid == -1) { db.AddParameter("@iCountryID", DBNull.Value); } else { db.AddParameter("@iCountryID", countryid); } if (stateid == -1) { db.AddParameter("@iStateID", DBNull.Value); } else { db.AddParameter("@iStateID", stateid); } if (city=="") { db.AddParameter("@sCity", DBNull.Value); } else { db.AddParameter("@sCity", city); } dsTemp = db.ExecuteDataSet("JobsDb_JobPostings_SelectForMatchingSkills"); db.Parameters.Clear(); ds.Merge(dsTemp); if (flag == false) { DataColumn[] pk = new DataColumn[1]; pk[0] = ds.Tables[0].Columns["postingid"]; ds.Tables[0].PrimaryKey = pk; flag = true; } } return ds; }
/// <summary> /// 获取最近七天的职位信息 /// </summary> /// <returns></returns> public static DataSet GetLatest() { DBAccess db = new DBAccess(); return db.ExecuteDataSet("JobsDb_JobPostings_GetLatest"); }
public static DataSet GetPostings(string username) { DBAccess db = new DBAccess(); db.Parameters.Add(new SqlParameter("@sUserName", username)); DataSet ds = db.ExecuteDataSet("JobsDb_JobPostings_SelectByUser"); return ds; }
public static DataSet GetExperienceLevels() { DBAccess db = new DBAccess(); return db.ExecuteDataSet("JobsDb_ExperienceLevels_SelectAll"); }
public static DataSet GetMyResumes(string username) { DBAccess db = new DBAccess(); db.AddParameter("@sUserName", username); return db.ExecuteDataSet("JobsDb_MyResumes_SelectForUser"); }
public static DataSet GetStates(int countryid) { DBAccess db = new DBAccess(); db.AddParameter("@iCountryID", countryid); return db.ExecuteDataSet("JobsDb_States_SelectForCountry"); }
public static DataSet GetStates() { DBAccess db = new DBAccess(); return db.ExecuteDataSet("JobsDb_States_SelectAll"); }
public DataSet SelectCountries() { DBAccess db = new DBAccess(); return db.ExecuteDataSet("JobsDb_Countries_SelectAll"); }