/// <summary> /// 获取PTJobTable表中content网页所需数据[cat66] /// </summary> /// <param name="empid"></param> /// <returns></returns> public static List <PTJobTable> getPtInfo(int empid, string name) { string sql = "select * from PTJobTable where pt_eId=@empid and pt_Name=@name"; //SqlParameter[] p = new SqlParameter[] { }; DataTable dt = SqlHelper.ExecuteDataTable(sql, new SqlParameter("empid", empid), new SqlParameter("name", name)); List <PTJobTable> l = new List <PTJobTable>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { try { PTJobTable pt = new PTJobTable(); //bg.bg_Id = Convert.ToInt32(row["bg_Id"]); //bg.bg_Name = row["bg_Name"].ToString(); //bg.bg_Pwd = row["bg_Pwd"].ToString(); //l.Add(bg); pt.pt_Name = row["pt_Name"].ToString(); pt.pt_Address = row["pt_Address"].ToString(); pt.pt_Money = Convert.ToInt32(row["pt_Money"]); pt.pt_Time = row["pt_Time"].ToString(); l.Add(pt); } catch { } } } return(l); }
/// <summary> /// 获取热门兼职的数据 /// </summary> /// <returns>兼职表的集合</returns> public static List <PTJobTable> getHotName() { string sql = "select top 100 pt_Id, pt_Name,pt_StuId,pt_Kind from PTJobTable order by pt_State desc ,pt_Id desc"; SqlParameter[] p = new SqlParameter[] { }; DataTable dt = SqlHelper.ExecuteDataTable(sql, p); List <PTJobTable> l = new List <PTJobTable>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { try { PTJobTable pt = new PTJobTable(); pt.pt_Id = Convert.ToInt32(row["pt_Id"]); pt.pt_Name = row["pt_Name"].ToString(); pt.pt_StuId = Convert.ToInt32(row["pt_StuId"]); pt.pt_Kind = row["pt_Kind"].ToString(); l.Add(pt); } catch { } } } return(l); }
public static void SetDr2Model(DataRow dr, Delivery model) { if (dr["PT_Id"].ToString() != "") { model.PT_Id = int.Parse(dr["PT_Id"].ToString()); model.DE_PTJob = new PTJob(); PTJobTable.SetDr2Model(dr, model.DE_PTJob); } if (dr["DE_Id"].ToString() != "") { model.DE_Id = int.Parse(dr["DE_Id"].ToString()); } if (dr["RE_Id"].ToString() != "") { model.RE_Id = int.Parse(dr["RE_Id"].ToString()); model.DE_Resume = new Resume(); ResumeTable.SetDr2Model(dr, model.DE_Resume); } model.RE_Pass = dr["RE_Pass"].ToString(); if (dr["DE_Time"].ToString() != "") { model.DE_Time = DateTime.Parse(dr["DE_Time"].ToString()); } }