public int InsertCountry(Country c) { DBAccess db = new DBAccess(); SqlParameter p = new SqlParameter("@iCountryID", 0); p.Direction = ParameterDirection.Output; db.AddParameter("@sCountryName", c.CountryName); db.AddParameter(p); return db.ExecuteNonQuery("JobsDb_Countries_Insert"); }
public static int Insert(ExperienceLevel l) { DBAccess db = new DBAccess(); db.AddParameter("@sExperienceLevelName", l.ExperienceLevelName); SqlParameter p = new SqlParameter("@iExperienceLevelID", SqlDbType.Int); p.Direction = ParameterDirection.Output; db.AddParameter(p); int retval = db.ExecuteNonQuery("JobsDb_ExperienceLevels_Insert"); if (retval == 1) { return int.Parse(p.Value.ToString()); } else { return -1; } }
public static int Insert(MyResume r) { DBAccess db = new DBAccess(); db.AddParameter("@iResumeID", r.ResumeID); db.AddParameter("@sUserName", r.UserName); SqlParameter p = new SqlParameter("@iMyResumeID", SqlDbType.Int); p.Direction = ParameterDirection.Output; db.AddParameter(p); int retval = db.ExecuteNonQuery("JobsDb_MyResumes_Insert"); if (retval == 1) { return int.Parse(p.Value.ToString()); } else { return -1; } }
public static int Delete(JobPosting p) { DBAccess db = new DBAccess(); db.Parameters.Add(new SqlParameter("@iPostingID", p.JobPostingID)); int retval = db.ExecuteNonQuery("JobsDb_JobPostings_Delete"); return retval; }
/// <summary> /// 更新一条简历 /// </summary> /// <param name="r"></param> /// <returns></returns> public static int Update(Resume r) { DBAccess db = new DBAccess(); db.AddParameter("@iResumeID", r.ResumeID); db.AddParameter("@sJobTitle", r.JobTitle); db.AddParameter("@sTargetCity", r.City); db.AddParameter("@iTargateStateID", r.StateID); db.AddParameter("@iTargetCountryID", r.CountryID); db.AddParameter("@iRelocationCountryID", r.RelocationCountryID); db.AddParameter("@iTargetJobTypeID", r.JobTypeID); db.AddParameter("@iEducationLevelID", r.EducationLevelID); db.AddParameter("@iExperienceLevelID", r.ExperienceLevelID); db.AddParameter("@sResumeText", r.ResumeText); db.AddParameter("@sCoverLetterText", r.CoveringLetterText); db.AddParameter("@sUserName", r.UserName); db.AddParameter("@dtPostDate", r.PostedDate); return db.ExecuteNonQuery("JobsDb_Resumes_Update"); }
/// <summary> /// 插入一个新的简历 /// </summary> /// <param name="r"></param> /// <returns></returns> public static int Insert(Resume r) { DBAccess db = new DBAccess(); db.AddParameter("@sJobTitle", r.JobTitle); db.AddParameter("@sTargetCity", r.City); db.AddParameter("@iTargateStateID", r.StateID); db.AddParameter("@iTargetCountryID", r.CountryID); db.AddParameter("@iRelocationCountryID", r.RelocationCountryID); db.AddParameter("@iTargetJobTypeID", r.JobTypeID); db.AddParameter("@iEducationLevelID", r.EducationLevelID); db.AddParameter("@iExperienceLevelID", r.ExperienceLevelID); db.AddParameter("@sResumeText", r.ResumeText); db.AddParameter("@sCoverLetterText", r.CoveringLetterText); db.AddParameter("@sUserName", r.UserName); db.AddParameter("@dtPostDate", r.PostedDate); SqlParameter p=new SqlParameter("@iResumeID",SqlDbType.Int); p.Direction=ParameterDirection.Output; db.AddParameter(p); int retval=db.ExecuteNonQuery("JobsDb_Resumes_Insert"); if (retval <= 0) { return -1; } else { return (int)p.Value; } }
/// <summary> /// 根据指定的简历编号删除简历 /// </summary> /// <param name="ResumeID"></param> /// <returns></returns> public static int Delete(int ResumeID) { DBAccess db = new DBAccess(); db.AddParameter("@iResumeID", ResumeID); return db.ExecuteNonQuery("JobsDb_Resumes_Delete"); }
public static int Update(ExperienceLevel l) { DBAccess db = new DBAccess(); db.AddParameter("@iExperienceLevelID", l.ExperienceLevelID); db.AddParameter("@sExperienceLevelName", l.ExperienceLevelName); return db.ExecuteNonQuery("JobsDb_ExperienceLevels_Update"); }
public static int Update(Company c) { DBAccess db = new DBAccess(); db.Parameters.Add(new SqlParameter("@iCompanyID", c.CompanyID)); db.Parameters.Add(new SqlParameter("@sUserName", c.UserName)); db.Parameters.Add(new SqlParameter("@sCompanyName", c.CompanyName)); db.Parameters.Add(new SqlParameter("@sAddress1", c.Address1)); db.Parameters.Add(new SqlParameter("@sAddress2", c.Address2)); db.Parameters.Add(new SqlParameter("@sCity", c.City)); db.Parameters.Add(new SqlParameter("@iStateID", c.StateID)); db.Parameters.Add(new SqlParameter("@iCountryID", c.CountryID)); db.Parameters.Add(new SqlParameter("@sZip", c.ZIP)); db.Parameters.Add(new SqlParameter("@sPhone", c.Phone)); db.Parameters.Add(new SqlParameter("@sFax", c.Fax)); db.Parameters.Add(new SqlParameter("@sCompanyEmail", c.Email)); db.Parameters.Add(new SqlParameter("@sWebSiteUrl", c.WebSiteUrl)); db.Parameters.Add(new SqlParameter("@sCompanyProfile", c.BriefProfile)); int retval = db.ExecuteNonQuery("JobsDb_Companies_Update"); return retval; }
public static int Insert(Company c) { DBAccess db = new DBAccess(); SqlParameter objParam = new SqlParameter("@iCompanyID",0); objParam.Direction = ParameterDirection.Output; db.Parameters.Add(new SqlParameter("@sUserName", c.UserName)); db.Parameters.Add(new SqlParameter("@sCompanyName", c.CompanyName)); db.Parameters.Add(new SqlParameter("@sAddress1", c.Address1)); db.Parameters.Add(new SqlParameter("@sAddress2", c.Address2)); db.Parameters.Add(new SqlParameter("@sCity", c.City)); db.Parameters.Add(new SqlParameter("@iStateID", c.StateID)); db.Parameters.Add(new SqlParameter("@iCountryID", c.CountryID)); db.Parameters.Add(new SqlParameter("@sZip", c.ZIP)); db.Parameters.Add(new SqlParameter("@sPhone", c.Phone)); db.Parameters.Add(new SqlParameter("@sFax", c.Fax)); db.Parameters.Add(new SqlParameter("@sCompanyEmail", c.Email)); db.Parameters.Add(new SqlParameter("@sWebSiteUrl", c.WebSiteUrl)); db.Parameters.Add(new SqlParameter("@sCompanyProfile", c.BriefProfile)); db.Parameters.Add(objParam); int retval = db.ExecuteNonQuery("JobsDb_Companies_Insert"); if (retval == 1) { return int.Parse(objParam.Value.ToString()); } else { return -1; } }
public static int Delete(EducationLevel e) { DBAccess db = new DBAccess(); db.AddParameter("@iEducationLevelID",e.EducationLevelID); return db.ExecuteNonQuery("JobsDb_EducationLevels_Delete"); }
public static int Insert(MySearch s) { DBAccess db = new DBAccess(); db.AddParameter("@sSearchCriteria", s.Criteria); db.AddParameter("@iCountryID", s.CountryID); db.AddParameter("@iStateID", s.StateID); db.AddParameter("@iCity", s.City); db.AddParameter("@sUserName", s.UserName); SqlParameter p = new SqlParameter("@iMySearchID", SqlDbType.Int); p.Direction = ParameterDirection.Output; db.AddParameter(p); int retval=db.ExecuteNonQuery("JobsDb_MySearches_Insert"); if (retval == 1) { return int.Parse(p.Value.ToString()); } else { return -1; } }
public static int Delete(MySearch s) { DBAccess db = new DBAccess(); db.AddParameter("@iMySearchID", s.MySearchID); return db.ExecuteNonQuery("JobsDb_MySearches_Delete"); }
public int UpdateCountry(Country c) { DBAccess db = new DBAccess(); db.AddParameter("@iCountryID", c.CountryID); db.AddParameter("@sCountryName", c.CountryName); return db.ExecuteNonQuery("JobsDb_Countries_Update"); }
public static int Insert(JobPosting p) { DBAccess db = new DBAccess(); SqlParameter objParam = new SqlParameter("@iPostingID", 0); objParam.Direction = ParameterDirection.Output; db.Parameters.Add(new SqlParameter("@iCompanyID", p.CompanyID)); db.Parameters.Add(new SqlParameter("@sContactPerson", p.ContactPerson)); db.Parameters.Add(new SqlParameter("@sTitle", p.Title)); db.Parameters.Add(new SqlParameter("@sDepartment", p.Department)); db.Parameters.Add(new SqlParameter("@sJobCode", p.JobCode)); db.Parameters.Add(new SqlParameter("@sCity", p.City)); db.Parameters.Add(new SqlParameter("@iStateID", p.StateID)); db.Parameters.Add(new SqlParameter("@iCountryID", p.CountryID)); db.Parameters.Add(new SqlParameter("@iEducationLevelID", p.EducationLevelID)); db.Parameters.Add(new SqlParameter("@iJobTypeID", p.JobTypeID)); db.Parameters.Add(new SqlParameter("@curMinSalary", p.MinSalary)); db.Parameters.Add(new SqlParameter("@curMaxSalary", p.MaxSalary)); db.Parameters.Add(new SqlParameter("@sJobDescription", p.Description)); db.Parameters.Add(new SqlParameter("@daPostingDate", p.PostingDate)); db.Parameters.Add(new SqlParameter("@sPostedBy", p.PostedBy)); db.Parameters.Add(objParam); int retval = db.ExecuteNonQuery("JobsDb_JobPostings_Insert"); if (retval == 1) { return int.Parse(objParam.Value.ToString()); } else { return -1; } }
public static int Update(JobPosting p) { DBAccess db = new DBAccess(); db.Parameters.Add(new SqlParameter("@iPostingID", p.JobPostingID)); db.Parameters.Add(new SqlParameter("@iCompanyID", p.CompanyID)); db.Parameters.Add(new SqlParameter("@sContactPerson", p.ContactPerson)); db.Parameters.Add(new SqlParameter("@sTitle", p.Title)); db.Parameters.Add(new SqlParameter("@sDepartment", p.Department)); db.Parameters.Add(new SqlParameter("@sJobCode", p.JobCode)); db.Parameters.Add(new SqlParameter("@sCity", p.City)); db.Parameters.Add(new SqlParameter("@iStateID", p.StateID)); db.Parameters.Add(new SqlParameter("@iCountryID", p.CountryID)); db.Parameters.Add(new SqlParameter("@iEducationLevelID", p.EducationLevelID)); db.Parameters.Add(new SqlParameter("@iJobTypeID", p.JobTypeID)); db.Parameters.Add(new SqlParameter("@curMinSalary", p.MinSalary)); db.Parameters.Add(new SqlParameter("@curMaxSalary", p.MaxSalary)); db.Parameters.Add(new SqlParameter("@sJobDescription", p.Description)); db.Parameters.Add(new SqlParameter("@daPostingDate", p.PostingDate)); db.Parameters.Add(new SqlParameter("@sPostedBy", p.PostedBy)); int retval = db.ExecuteNonQuery("JobsDb_JobPostings_Update"); return retval; }
public static int Delete(MyJob j) { DBAccess db = new DBAccess(); db.AddParameter("@iMyJobID",j.MyJobID); return db.ExecuteNonQuery("JobsDb_MyJobs_Delete"); }