示例#1
0
        protected override IDbDataParameter[] CreateSelectParameters(EntityBase anEntity)
        {
            M_MAINTAINANCE_REQUEST  theEntity = (M_MAINTAINANCE_REQUEST)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.JOB_CARD_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_JOB_CARD_ID", theEntity.JOB_CARD_ID));
            }

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

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

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

            return(cmdParams.ToArray());
        }
示例#2
0
        protected override EntityBase CreateAndBuildEntity(DataHelper.Framework.SafeDataReader dr)
        {
            M_MAINTAINANCE_REQUEST theEntity = new M_MAINTAINANCE_REQUEST();

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

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

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

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

            return(theEntity);
        }