Beispiel #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.WORK.WORK_ORDER_HEADER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.WORK_ORDER_HEADER 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.WAREHOUSE               = model.WAREHOUSE;
                entity.COMPANY                 = model.COMPANY;
                entity.ITEM                    = model.ITEM;
                entity.ITEM_DESC               = model.ITEM_DESC;
                entity.REVISION_NUM            = model.REVISION_NUM;
                entity.WORK_ORDER_ID           = model.WORK_ORDER_ID;
                entity.BUILD_LOC               = model.BUILD_LOC;
                entity.TOTAL_QTY               = model.TOTAL_QTY;
                entity.OPEN_QTY                = model.OPEN_QTY;
                entity.BUILT_QTY               = model.BUILT_QTY;
                entity.QTY_UM                  = model.QTY_UM;
                entity.DUE_DATE                = model.DUE_DATE;
                entity.CREATED_DATE_TIME       = model.CREATED_DATE_TIME;
                entity.RELEASED_DATE_TIME      = model.RELEASED_DATE_TIME;
                entity.COMPLETION_DATE_TIME    = model.COMPLETION_DATE_TIME;
                entity.PLANNED_UNIT_BUILD_TIME = model.PLANNED_UNIT_BUILD_TIME;
                entity.MANUALLY_ENTERED        = model.MANUALLY_ENTERED;
                entity.BUILD_INSTRUCTIONS      = model.BUILD_INSTRUCTIONS;
                entity.USER_DEF1               = model.USER_DEF1;
                entity.USER_DEF2               = model.USER_DEF2;
                entity.USER_DEF3               = model.USER_DEF3;
                entity.USER_DEF4               = model.USER_DEF4;
                entity.USER_DEF5               = model.USER_DEF5;
                entity.USER_DEF6               = model.USER_DEF6;
                entity.USER_DEF7               = model.USER_DEF7;
                entity.USER_DEF8               = model.USER_DEF8;
                entity.USER_STAMP              = model.USER_STAMP;
                entity.PROCESS_STAMP           = model.PROCESS_STAMP;
                entity.LAST_MODIFIED_DATE_TIME = model.LAST_MODIFIED_DATE_TIME;
                entity.IN_ALLOCATION           = model.IN_ALLOCATION;
                entity.CONDITION               = model.CONDITION;
                entity.ALLOC_ATTEMPTED         = model.ALLOC_ATTEMPTED;
                entity.IN_CONFIRMATION         = model.IN_CONFIRMATION;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.WORK.WORK_ORDER_HEADER_MODEL);
                Type typeE = typeof(Apps.Models.WORK_ORDER_HEADER);
                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);
        }
Beispiel #2
0
        public virtual Apps.Models.SCV.WORK.WORK_ORDER_HEADER_MODEL GetById(string id)
        {
            Apps.Models.WORK_ORDER_HEADER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //WORK_ORDER_HEADER entity = m_Rep.GetById(id);
                Apps.Models.SCV.WORK.WORK_ORDER_HEADER_MODEL model = new Apps.Models.SCV.WORK.WORK_ORDER_HEADER_MODEL();
                model.INTERNAL_NUM            = entity.INTERNAL_NUM;
                model.WAREHOUSE               = entity.WAREHOUSE;
                model.COMPANY                 = entity.COMPANY;
                model.ITEM                    = entity.ITEM;
                model.ITEM_DESC               = entity.ITEM_DESC;
                model.REVISION_NUM            = entity.REVISION_NUM;
                model.WORK_ORDER_ID           = entity.WORK_ORDER_ID;
                model.BUILD_LOC               = entity.BUILD_LOC;
                model.TOTAL_QTY               = entity.TOTAL_QTY;
                model.OPEN_QTY                = entity.OPEN_QTY;
                model.BUILT_QTY               = entity.BUILT_QTY;
                model.QTY_UM                  = entity.QTY_UM;
                model.DUE_DATE                = entity.DUE_DATE;
                model.CREATED_DATE_TIME       = entity.CREATED_DATE_TIME;
                model.RELEASED_DATE_TIME      = entity.RELEASED_DATE_TIME;
                model.COMPLETION_DATE_TIME    = entity.COMPLETION_DATE_TIME;
                model.PLANNED_UNIT_BUILD_TIME = entity.PLANNED_UNIT_BUILD_TIME;
                model.MANUALLY_ENTERED        = entity.MANUALLY_ENTERED;
                model.BUILD_INSTRUCTIONS      = entity.BUILD_INSTRUCTIONS;
                model.USER_DEF1               = entity.USER_DEF1;
                model.USER_DEF2               = entity.USER_DEF2;
                model.USER_DEF3               = entity.USER_DEF3;
                model.USER_DEF4               = entity.USER_DEF4;
                model.USER_DEF5               = entity.USER_DEF5;
                model.USER_DEF6               = entity.USER_DEF6;
                model.USER_DEF7               = entity.USER_DEF7;
                model.USER_DEF8               = entity.USER_DEF8;
                model.USER_STAMP              = entity.USER_STAMP;
                model.PROCESS_STAMP           = entity.PROCESS_STAMP;
                model.LAST_MODIFIED_DATE_TIME = entity.LAST_MODIFIED_DATE_TIME;
                model.IN_ALLOCATION           = entity.IN_ALLOCATION;
                model.CONDITION               = entity.CONDITION;
                model.ALLOC_ATTEMPTED         = entity.ALLOC_ATTEMPTED;
                model.IN_CONFIRMATION         = entity.IN_CONFIRMATION;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.WORK.WORK_ORDER_HEADER_MODEL model)
        {
            Apps.Models.WORK_ORDER_HEADER entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.WORK_ORDER_HEADER();
            entity.INTERNAL_NUM            = model.INTERNAL_NUM;
            entity.WAREHOUSE               = model.WAREHOUSE;
            entity.COMPANY                 = model.COMPANY;
            entity.ITEM                    = model.ITEM;
            entity.ITEM_DESC               = model.ITEM_DESC;
            entity.REVISION_NUM            = model.REVISION_NUM;
            entity.WORK_ORDER_ID           = model.WORK_ORDER_ID;
            entity.BUILD_LOC               = model.BUILD_LOC;
            entity.TOTAL_QTY               = model.TOTAL_QTY;
            entity.OPEN_QTY                = model.OPEN_QTY;
            entity.BUILT_QTY               = model.BUILT_QTY;
            entity.QTY_UM                  = model.QTY_UM;
            entity.DUE_DATE                = model.DUE_DATE;
            entity.CREATED_DATE_TIME       = model.CREATED_DATE_TIME;
            entity.RELEASED_DATE_TIME      = model.RELEASED_DATE_TIME;
            entity.COMPLETION_DATE_TIME    = model.COMPLETION_DATE_TIME;
            entity.PLANNED_UNIT_BUILD_TIME = model.PLANNED_UNIT_BUILD_TIME;
            entity.MANUALLY_ENTERED        = model.MANUALLY_ENTERED;
            entity.BUILD_INSTRUCTIONS      = model.BUILD_INSTRUCTIONS;
            entity.USER_DEF1               = model.USER_DEF1;
            entity.USER_DEF2               = model.USER_DEF2;
            entity.USER_DEF3               = model.USER_DEF3;
            entity.USER_DEF4               = model.USER_DEF4;
            entity.USER_DEF5               = model.USER_DEF5;
            entity.USER_DEF6               = model.USER_DEF6;
            entity.USER_DEF7               = model.USER_DEF7;
            entity.USER_DEF8               = model.USER_DEF8;
            entity.USER_STAMP              = model.USER_STAMP;
            entity.PROCESS_STAMP           = model.PROCESS_STAMP;
            entity.LAST_MODIFIED_DATE_TIME = model.LAST_MODIFIED_DATE_TIME;
            entity.IN_ALLOCATION           = model.IN_ALLOCATION;
            entity.CONDITION               = model.CONDITION;
            entity.ALLOC_ATTEMPTED         = model.ALLOC_ATTEMPTED;
            entity.IN_CONFIRMATION         = model.IN_CONFIRMATION;

            m_Rep.Create(entity);
        }