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

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

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

            try
            {
                lastInsertId = b.Insert("Fuel_Request_Info", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
        public int Update(FuelRequestInfoVO vo)
        {
            int ID = 0;

            try
            {
                b.Update("Fuel_Request_Info", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo));
                ID = vo.Id;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(ID);
        }