public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.TASK.TASK_CREATION_MASTER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.TASK_CREATION_MASTER entity = m_Rep.GetById(model.INTERNAL_MASTER_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_MASTER_NUM  = model.INTERNAL_MASTER_NUM;
                entity.RECORD_TYPE          = model.RECORD_TYPE;
                entity.DESCRIPTION          = model.DESCRIPTION;
                entity.TASK_TYPE            = model.TASK_TYPE;
                entity.PRIORITY             = model.PRIORITY;
                entity.FILTER_NAME          = model.FILTER_NAME;
                entity.MAXIMUM_QTY          = model.MAXIMUM_QTY;
                entity.QUANTITY_UM          = model.QUANTITY_UM;
                entity.MAXIMUM_WEIGHT       = model.MAXIMUM_WEIGHT;
                entity.WEIGHT_UM            = model.WEIGHT_UM;
                entity.MAXIMUM_VOLUME       = model.MAXIMUM_VOLUME;
                entity.VOLUME_UM            = model.VOLUME_UM;
                entity.MAXIMUM_INSTRUCTIONS = model.MAXIMUM_INSTRUCTIONS;
                entity.CREATE_USER          = model.CREATE_USER;
                entity.CREATE_DATE_TIME     = model.CREATE_DATE_TIME;
                entity.TASK_ID_FIELD        = model.TASK_ID_FIELD;
                entity.INTERNAL_TASK_TYPE   = model.INTERNAL_TASK_TYPE;
                entity.ACTIVE                = model.ACTIVE;
                entity.LAST_MODIFY_USER      = model.LAST_MODIFY_USER;
                entity.LAST_MODIFY_DATE_TIME = model.LAST_MODIFY_DATE_TIME;
                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;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.TASK.TASK_CREATION_MASTER_MODEL);
                Type typeE = typeof(Apps.Models.TASK_CREATION_MASTER);
                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 Apps.Models.SCV.TASK.TASK_CREATION_MASTER_MODEL GetById(string id)
        {
            Apps.Models.TASK_CREATION_MASTER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //TASK_CREATION_MASTER entity = m_Rep.GetById(id);
                Apps.Models.SCV.TASK.TASK_CREATION_MASTER_MODEL model = new Apps.Models.SCV.TASK.TASK_CREATION_MASTER_MODEL();
                model.INTERNAL_MASTER_NUM  = entity.INTERNAL_MASTER_NUM;
                model.RECORD_TYPE          = entity.RECORD_TYPE;
                model.DESCRIPTION          = entity.DESCRIPTION;
                model.TASK_TYPE            = entity.TASK_TYPE;
                model.PRIORITY             = entity.PRIORITY;
                model.FILTER_NAME          = entity.FILTER_NAME;
                model.MAXIMUM_QTY          = entity.MAXIMUM_QTY;
                model.QUANTITY_UM          = entity.QUANTITY_UM;
                model.MAXIMUM_WEIGHT       = entity.MAXIMUM_WEIGHT;
                model.WEIGHT_UM            = entity.WEIGHT_UM;
                model.MAXIMUM_VOLUME       = entity.MAXIMUM_VOLUME;
                model.VOLUME_UM            = entity.VOLUME_UM;
                model.MAXIMUM_INSTRUCTIONS = entity.MAXIMUM_INSTRUCTIONS;
                model.CREATE_USER          = entity.CREATE_USER;
                model.CREATE_DATE_TIME     = entity.CREATE_DATE_TIME;
                model.TASK_ID_FIELD        = entity.TASK_ID_FIELD;
                model.INTERNAL_TASK_TYPE   = entity.INTERNAL_TASK_TYPE;
                model.ACTIVE                = entity.ACTIVE;
                model.LAST_MODIFY_USER      = entity.LAST_MODIFY_USER;
                model.LAST_MODIFY_DATE_TIME = entity.LAST_MODIFY_DATE_TIME;
                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;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.TASK.TASK_CREATION_MASTER_MODEL model)
        {
            Apps.Models.TASK_CREATION_MASTER entity = m_Rep.GetById(model.INTERNAL_MASTER_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.TASK_CREATION_MASTER();
            entity.INTERNAL_MASTER_NUM  = model.INTERNAL_MASTER_NUM;
            entity.RECORD_TYPE          = model.RECORD_TYPE;
            entity.DESCRIPTION          = model.DESCRIPTION;
            entity.TASK_TYPE            = model.TASK_TYPE;
            entity.PRIORITY             = model.PRIORITY;
            entity.FILTER_NAME          = model.FILTER_NAME;
            entity.MAXIMUM_QTY          = model.MAXIMUM_QTY;
            entity.QUANTITY_UM          = model.QUANTITY_UM;
            entity.MAXIMUM_WEIGHT       = model.MAXIMUM_WEIGHT;
            entity.WEIGHT_UM            = model.WEIGHT_UM;
            entity.MAXIMUM_VOLUME       = model.MAXIMUM_VOLUME;
            entity.VOLUME_UM            = model.VOLUME_UM;
            entity.MAXIMUM_INSTRUCTIONS = model.MAXIMUM_INSTRUCTIONS;
            entity.CREATE_USER          = model.CREATE_USER;
            entity.CREATE_DATE_TIME     = model.CREATE_DATE_TIME;
            entity.TASK_ID_FIELD        = model.TASK_ID_FIELD;
            entity.INTERNAL_TASK_TYPE   = model.INTERNAL_TASK_TYPE;
            entity.ACTIVE                = model.ACTIVE;
            entity.LAST_MODIFY_USER      = model.LAST_MODIFY_USER;
            entity.LAST_MODIFY_DATE_TIME = model.LAST_MODIFY_DATE_TIME;
            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;

            m_Rep.Create(entity);
        }