Exemplo n.º 1
0
        public static List <StudentTable> getInfo(string user, out int id)
        {
            string sql = "select * from StudentTable where s_UserName = '******'";

            SqlParameter[]      p  = new SqlParameter[] { };
            DataTable           dt = SqlHelper.ExecuteDataTable(sql, p);
            List <StudentTable> l  = new List <StudentTable>();

            id = 0;
            if (dt.Rows.Count > 0)
            {
                StudentTable stu = new StudentTable();
                stu.s_id           = Convert.ToInt32(dt.Rows[0]["s_Id"]);
                id                 = stu.s_id;
                stu.s_RealName     = dt.Rows[0]["s_RealName"].ToString();
                stu.s_Professional = dt.Rows[0]["s_Professional"].ToString();
                stu.s_Department   = dt.Rows[0]["s_Department"].ToString();
                stu.s_Phone        = dt.Rows[0]["s_Phone"].ToString();
                stu.s_Sex          = dt.Rows[0]["s_Sex"].ToString();
                stu.s_Address      = dt.Rows[0]["s_Address"].ToString();
                stu.s_Email        = dt.Rows[0]["s_Email"].ToString();
                stu.s_PhotoPath    = dt.Rows[0]["s_PhotoPath"].ToString();
                l.Add(stu);
            }

            return(l);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 将兼职表的数据行转换成model
 /// </summary>
 /// <param name="dr"></param>
 /// <param name="model">空</param>
 public static void SetDr2Model(DataRow dr, PTJob model)
 {
     if (dr["pt_Id"].ToString() != "")
     {
         model.pt_Id = int.Parse(dr["pt_Id"].ToString());
     }
     model.pt_Kind        = dr["pt_Kind"].ToString();
     model.pt_Time        = dr["pt_Time"].ToString();
     model.pt_ReleaseTime = dr["pt_ReleaseTime"].ToString();
     if (dr["pt_eId"].ToString() != "")
     {
         model.pt_eId      = int.Parse(dr["pt_eId"].ToString());
         model.Pt_employee = new Employee();
         EmployeeTable.SetDr2Model(dr, model.Pt_employee);
     }
     if (dr["pt_Money"].ToString() != "")
     {
         model.pt_Money = int.Parse(dr["pt_Money"].ToString());
     }
     model.pt_Address = dr["pt_Address"].ToString();
     model.pt_Tel     = dr["pt_Tel"].ToString();
     model.pt_State   = dr["pt_State"].ToString();
     model.pt_Name    = dr["pt_Name"].ToString();
     model.pt_Kind    = dr["pt_Kind"].ToString();
     if (dr["pt_StuId"].ToString() != "")
     {
         model.pt_StuId   = int.Parse(dr["pt_StuId"].ToString());
         model.Pt_student = new Student();
         StudentTable.SetDr2Model(dr, model.Pt_student);
     }
     if (dr["pt_Need"].ToString() != "")
     {
         model.pt_Need = int.Parse(dr["pt_Need"].ToString());
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 插入数据[cat66]
        /// </summary>
        /// <param name="user"></param>
        public static void insertdata(string user, int ptid)
        {
            //int ptid=1;
            int sid  = StudentTable.getstuid(user);
            int reid = ResumeTable.getreid(sid);

            string sql = "insert into DeliveryTable(RE_Id,PT_Id) values(@reid,@ptid)";

            SqlHelper.ExecuteNonQuery(sql, new SqlParameter("reid", reid), new SqlParameter("ptid", ptid));
        }
Exemplo n.º 4
0
 public static void SetDr2Model(DataRow dr, Resume model)
 {
     if (dr["re_UserId"].ToString() != "")
     {
         model.re_UserId  = int.Parse(dr["re_UserId"].ToString());
         model.Re_Student = new Student();
         StudentTable.SetDr2Model(dr, model.Re_Student);
     }
     if (dr["re_Id"].ToString() != "")
     {
         model.re_Id = int.Parse(dr["re_Id"].ToString());
     }
     model.re_Skill    = dr["re_Skill"].ToString();
     model.re_Edu      = dr["re_Edu"].ToString();
     model.re_Describe = dr["re_Describe"].ToString();
     model.re_WorkTime = dr["re_WorkTime"].ToString();
 }
Exemplo n.º 5
0
        public static List <StudentTable> getAll(int page, string search)
        {
            string sql = "select * from StudentTable where s_Id = '" + search + "' or s_UserName like '%" + search + "%' or s_Professional like '%" + search + "%' or s_Department like '%" + search + "%'  or s_Phone like '%" + search + "%'  order by s_Id offset @page rows fetch next 5 rows only";

            SqlParameter[]      p  = new SqlParameter[] { new SqlParameter("@page", (page - 1) * 5) };
            DataTable           dt = SqlHelper.ExecuteDataTable(sql, p);
            List <StudentTable> l  = new List <StudentTable>();

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    StudentTable stu = new StudentTable();
                    stu.s_id           = Convert.ToInt32(row["s_Id"]);
                    stu.s_UserName     = row["s_UserName"].ToString();
                    stu.s_Professional = row["s_Professional"].ToString();
                    stu.s_Department   = row["s_Department"].ToString();
                    stu.s_Phone        = row["s_Phone"].ToString();
                    l.Add(stu);
                }
            }
            return(l);
        }