Ejemplo n.º 1
0
        public virtual Apps.Models.SCV.INTERFACE.INTERFACE_PROCESS_MODEL GetById(string id)
        {
            Apps.Models.INTERFACE_PROCESS entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //INTERFACE_PROCESS entity = m_Rep.GetById(id);
                Apps.Models.SCV.INTERFACE.INTERFACE_PROCESS_MODEL model = new Apps.Models.SCV.INTERFACE.INTERFACE_PROCESS_MODEL();
                model.INTERNAL_NUM          = entity.INTERNAL_NUM;
                model.DESCRIPTION           = entity.DESCRIPTION;
                model.INTERFACE_TYPE        = entity.INTERFACE_TYPE;
                model.DIRECTION             = entity.DIRECTION;
                model.INTERFACE_MODE        = entity.INTERFACE_MODE;
                model.PRE_INTERFACE_ACTION  = entity.PRE_INTERFACE_ACTION;
                model.POST_INTERFACE_ACTION = entity.POST_INTERFACE_ACTION;
                model.INTERFACE_ACTION      = entity.INTERFACE_ACTION;
                model.SAVE_DATA             = entity.SAVE_DATA;
                model.TRANSACTION_SIZE      = entity.TRANSACTION_SIZE;
                model.ACTIVE          = entity.ACTIVE;
                model.IN_PROCESS      = entity.IN_PROCESS;
                model.LAST_RUN_TIME   = entity.LAST_RUN_TIME;
                model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP;
                model.USER_STAMP      = entity.USER_STAMP;
                model.LAST_RUN_RESULT = entity.LAST_RUN_RESULT;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.INTERFACE.INTERFACE_PROCESS_MODEL model)
        {
            Apps.Models.INTERFACE_PROCESS entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.INTERFACE_PROCESS();
            entity.INTERNAL_NUM          = model.INTERNAL_NUM;
            entity.DESCRIPTION           = model.DESCRIPTION;
            entity.INTERFACE_TYPE        = model.INTERFACE_TYPE;
            entity.DIRECTION             = model.DIRECTION;
            entity.INTERFACE_MODE        = model.INTERFACE_MODE;
            entity.PRE_INTERFACE_ACTION  = model.PRE_INTERFACE_ACTION;
            entity.POST_INTERFACE_ACTION = model.POST_INTERFACE_ACTION;
            entity.INTERFACE_ACTION      = model.INTERFACE_ACTION;
            entity.SAVE_DATA             = model.SAVE_DATA;
            entity.TRANSACTION_SIZE      = model.TRANSACTION_SIZE;
            entity.ACTIVE          = model.ACTIVE;
            entity.IN_PROCESS      = model.IN_PROCESS;
            entity.LAST_RUN_TIME   = model.LAST_RUN_TIME;
            entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP;
            entity.USER_STAMP      = model.USER_STAMP;
            entity.LAST_RUN_RESULT = model.LAST_RUN_RESULT;

            m_Rep.Create(entity);
        }
Ejemplo n.º 3
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.INTERFACE.INTERFACE_PROCESS_MODEL model, params string[] updateProperties)
        {
            Apps.Models.INTERFACE_PROCESS 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.DESCRIPTION           = model.DESCRIPTION;
                entity.INTERFACE_TYPE        = model.INTERFACE_TYPE;
                entity.DIRECTION             = model.DIRECTION;
                entity.INTERFACE_MODE        = model.INTERFACE_MODE;
                entity.PRE_INTERFACE_ACTION  = model.PRE_INTERFACE_ACTION;
                entity.POST_INTERFACE_ACTION = model.POST_INTERFACE_ACTION;
                entity.INTERFACE_ACTION      = model.INTERFACE_ACTION;
                entity.SAVE_DATA             = model.SAVE_DATA;
                entity.TRANSACTION_SIZE      = model.TRANSACTION_SIZE;
                entity.ACTIVE          = model.ACTIVE;
                entity.IN_PROCESS      = model.IN_PROCESS;
                entity.LAST_RUN_TIME   = model.LAST_RUN_TIME;
                entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP;
                entity.USER_STAMP      = model.USER_STAMP;
                entity.LAST_RUN_RESULT = model.LAST_RUN_RESULT;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.INTERFACE.INTERFACE_PROCESS_MODEL);
                Type typeE = typeof(Apps.Models.INTERFACE_PROCESS);
                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);
        }