public TrainingAttendeeVO GetByID(int id) { TrainingAttendeeVO vo = new TrainingAttendeeVO(); DataTable dt = Select("ID=" + id + ""); if (dt.Rows.Count > 0) { vo = b.ConvertObj(dt.Rows[0], new TrainingAttendeeVO()) as TrainingAttendeeVO; } return(vo); }
public int Insert(TrainingAttendeeVO vo) { int lastInsertId = 0; try { lastInsertId = b.Insert("Training_Attendee", b.ConvertColName(vo), b.ConvertValueList(vo)); } catch (SqlException ex) { throw ex; } return(lastInsertId); }
public int Create(TrainingAttendeeVO vo) { int id; if (!dao.isExist(vo.Id.ToString())) { id = dao.Insert(vo); } else { id = dao.Update(vo); } return(id); }
public int Update(TrainingAttendeeVO vo) { int ID = 0; try { b.Update("Training_Attendee", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo)); ID = vo.Id; } catch (SqlException ex) { throw ex; } return(ID); }