public TripAssignVO GetByID(int id)
        {
            TripAssignVO vo = new TripAssignVO();
            DataTable    dt = Select("ID=" + id + "");

            if (dt.Rows.Count > 0)
            {
                vo = b.ConvertObj(dt.Rows[0], new TripAssignVO()) as TripAssignVO;
            }
            return(vo);
        }
Example #2
0
        public int Create(TripAssignVO vo)
        {
            int id;

            if (!dao.isExist(vo.Id.ToString()))
            {
                id = dao.Insert(vo);
            }
            else
            {
                id = dao.Update(vo);
            }
            return(id);
        }
        public int Insert(TripAssignVO vo)
        {
            int lastInsertId = 0;

            try
            {
                lastInsertId = b.Insert("Trip_Assign", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
        public int Update(TripAssignVO vo)
        {
            int categoryID = 0;

            try
            {
                b.Update("Trip_Assign", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo));
                categoryID = vo.Id;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(categoryID);
        }