public virtual Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL GetById(string id)
        {
            Apps.Models.INTERFACE_FAILURE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //INTERFACE_FAILURE entity = m_Rep.GetById(id);
                Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL model = new Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL();
                model.INTERNAL_NUM          = entity.INTERNAL_NUM;
                model.INTERFACE_TYPE        = entity.INTERFACE_TYPE;
                model.DIRECTION             = entity.DIRECTION;
                model.INTERFACE_RECORD_ID   = entity.INTERFACE_RECORD_ID;
                model.WAREHOUSE             = entity.WAREHOUSE;
                model.REFERENCE_ID          = entity.REFERENCE_ID;
                model.REFERENCE_LINE_NUM    = entity.REFERENCE_LINE_NUM;
                model.MESSAGE               = entity.MESSAGE;
                model.RETRY_TIMES           = entity.RETRY_TIMES;
                model.CREATE_DATE_TIME      = entity.CREATE_DATE_TIME;
                model.LAST_UPDATE_DATE_TIME = entity.LAST_UPDATE_DATE_TIME;
                model.PROCESS_STAMP         = entity.PROCESS_STAMP;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.INTERFACE_FAILURE entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_NUM          = model.INTERNAL_NUM;
                entity.INTERFACE_TYPE        = model.INTERFACE_TYPE;
                entity.DIRECTION             = model.DIRECTION;
                entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
                entity.WAREHOUSE             = model.WAREHOUSE;
                entity.REFERENCE_ID          = model.REFERENCE_ID;
                entity.REFERENCE_LINE_NUM    = model.REFERENCE_LINE_NUM;
                entity.MESSAGE               = model.MESSAGE;
                entity.RETRY_TIMES           = model.RETRY_TIMES;
                entity.CREATE_DATE_TIME      = model.CREATE_DATE_TIME;
                entity.LAST_UPDATE_DATE_TIME = model.LAST_UPDATE_DATE_TIME;
                entity.PROCESS_STAMP         = model.PROCESS_STAMP;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL);
                Type typeE = typeof(Apps.Models.INTERFACE_FAILURE);
                foreach (var item in updateProperties)
                {
                    System.Reflection.PropertyInfo pi  = type.GetProperty(item);
                    System.Reflection.PropertyInfo piE = typeE.GetProperty(item);
                    piE.SetValue(entity, pi.GetValue(model), null);
                }
            }


            m_Rep.Modify(entity, updateProperties);
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL model)
        {
            Apps.Models.INTERFACE_FAILURE entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.INTERFACE_FAILURE();
            entity.INTERNAL_NUM          = model.INTERNAL_NUM;
            entity.INTERFACE_TYPE        = model.INTERFACE_TYPE;
            entity.DIRECTION             = model.DIRECTION;
            entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
            entity.WAREHOUSE             = model.WAREHOUSE;
            entity.REFERENCE_ID          = model.REFERENCE_ID;
            entity.REFERENCE_LINE_NUM    = model.REFERENCE_LINE_NUM;
            entity.MESSAGE               = model.MESSAGE;
            entity.RETRY_TIMES           = model.RETRY_TIMES;
            entity.CREATE_DATE_TIME      = model.CREATE_DATE_TIME;
            entity.LAST_UPDATE_DATE_TIME = model.LAST_UPDATE_DATE_TIME;
            entity.PROCESS_STAMP         = model.PROCESS_STAMP;

            m_Rep.Create(entity);
        }