Example #1
0
        protected override EntityBase CreateAndBuildEntity(DataHelper.Framework.SafeDataReader dr)
        {
            FIVE_DIMENSION_RETURN theEntity = new FIVE_DIMENSION_RETURN();

            theEntity.PK_ID = !dr.IsDBNull(0) ? dr.GetValue(0).ToString() : string.Empty;

            theEntity.VEHICLE_ISSUE_ID = !dr.IsDBNull(1) ? dr.GetValue(1).ToString() : string.Empty;

            theEntity.DIMENSION = !dr.IsDBNull(2) ? dr.GetValue(2).ToString() : string.Empty;

            theEntity.SCRATCH = !dr.IsDBNull(3) ? dr.GetValue(3).ToString() : string.Empty;

            theEntity.MISSING = !dr.IsDBNull(4) ? dr.GetValue(4).ToString() : string.Empty;

            theEntity.BROKEN = !dr.IsDBNull(5) ? dr.GetValue(5).ToString() : string.Empty;

            theEntity.DENTED = !dr.IsDBNull(6) ? dr.GetValue(6).ToString() : string.Empty;

            theEntity.OTHERS = !dr.IsDBNull(7) ? dr.GetValue(7).ToString() : string.Empty;

            theEntity.OTHER_DESCRIPTION = !dr.IsDBNull(8) ? dr.GetValue(8).ToString() : string.Empty;

            theEntity.VEHICLE_ISSUE_RETURN_ID = !dr.IsDBNull(9) ? dr.GetValue(9).ToString() : string.Empty;

            return(theEntity);
        }
Example #2
0
        protected override IDbDataParameter[] CreateSelectParameters(EntityBase anEntity)
        {
            FIVE_DIMENSION_RETURN   theEntity = (FIVE_DIMENSION_RETURN)anEntity;
            List <IDbDataParameter> cmdParams = new List <IDbDataParameter>();

            if (!string.IsNullOrEmpty(theEntity.PK_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_PK_ID", theEntity.PK_ID));
            }

            if (!string.IsNullOrEmpty(theEntity.VEHICLE_ISSUE_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_VEHICLE_ISSUE_ID", theEntity.VEHICLE_ISSUE_ID));
            }

            if (!string.IsNullOrEmpty(theEntity.DIMENSION))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_DIMENSION", theEntity.DIMENSION));
            }

            if (!string.IsNullOrEmpty(theEntity.SCRATCH))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_SCRATCH", theEntity.SCRATCH));
            }

            if (!string.IsNullOrEmpty(theEntity.MISSING))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_MISSING", theEntity.MISSING));
            }

            if (!string.IsNullOrEmpty(theEntity.BROKEN))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_BROKEN", theEntity.BROKEN));
            }

            if (!string.IsNullOrEmpty(theEntity.DENTED))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_DENTED", theEntity.DENTED));
            }

            if (!string.IsNullOrEmpty(theEntity.OTHERS))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_OTHERS", theEntity.OTHERS));
            }

            if (!string.IsNullOrEmpty(theEntity.OTHER_DESCRIPTION))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_OTHER_DESCRIPTION", theEntity.OTHER_DESCRIPTION));
            }

            if (!string.IsNullOrEmpty(theEntity.VEHICLE_ISSUE_RETURN_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_VEHICLE_ISSUE_RETURN_ID", theEntity.VEHICLE_ISSUE_RETURN_ID));
            }

            cmdParams.Add(DataAccessFactory.CreateDataParameter("Result", ""));

            return(cmdParams.ToArray());
        }