Пример #1
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.TRANSFER.TRANSFER_ORDER_HEADER_MODEL model)
        {
            Apps.Models.TRANSFER_ORDER_HEADER entity = m_Rep.GetById(model.INTERNAL_TRANSFER_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.TRANSFER_ORDER_HEADER();
            entity.INTERNAL_TRANSFER_NUM = model.INTERNAL_TRANSFER_NUM;
            entity.TRANSFER_ID           = model.TRANSFER_ID;
            entity.LEADING_STS           = model.LEADING_STS;
            entity.CART_ID                 = model.CART_ID;
            entity.BEGIN_DATE_TIME         = model.BEGIN_DATE_TIME;
            entity.END_DATE_TIME           = model.END_DATE_TIME;
            entity.CREATED_USER            = model.CREATED_USER;
            entity.CREATED_DATE_TIME       = model.CREATED_DATE_TIME;
            entity.LAST_MODIFIED_USER      = model.LAST_MODIFIED_USER;
            entity.LAST_MODIFIED_DATE_TIME = model.LAST_MODIFIED_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;
            entity.WAREHOUSE               = model.WAREHOUSE;
            entity.COMPANY                 = model.COMPANY;
            entity.TRAILING_STS            = model.TRAILING_STS;

            m_Rep.Create(entity);
        }
Пример #2
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.TRANSFER.TRANSFER_ORDER_HEADER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.TRANSFER_ORDER_HEADER entity = m_Rep.GetById(model.INTERNAL_TRANSFER_NUM);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERNAL_TRANSFER_NUM = model.INTERNAL_TRANSFER_NUM;
                entity.TRANSFER_ID           = model.TRANSFER_ID;
                entity.LEADING_STS           = model.LEADING_STS;
                entity.CART_ID                 = model.CART_ID;
                entity.BEGIN_DATE_TIME         = model.BEGIN_DATE_TIME;
                entity.END_DATE_TIME           = model.END_DATE_TIME;
                entity.CREATED_USER            = model.CREATED_USER;
                entity.CREATED_DATE_TIME       = model.CREATED_DATE_TIME;
                entity.LAST_MODIFIED_USER      = model.LAST_MODIFIED_USER;
                entity.LAST_MODIFIED_DATE_TIME = model.LAST_MODIFIED_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;
                entity.WAREHOUSE               = model.WAREHOUSE;
                entity.COMPANY                 = model.COMPANY;
                entity.TRAILING_STS            = model.TRAILING_STS;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.TRANSFER.TRANSFER_ORDER_HEADER_MODEL);
                Type typeE = typeof(Apps.Models.TRANSFER_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);
        }
Пример #3
0
        public virtual Apps.Models.SCV.TRANSFER.TRANSFER_ORDER_HEADER_MODEL GetById(string id)
        {
            Apps.Models.TRANSFER_ORDER_HEADER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //TRANSFER_ORDER_HEADER entity = m_Rep.GetById(id);
                Apps.Models.SCV.TRANSFER.TRANSFER_ORDER_HEADER_MODEL model = new Apps.Models.SCV.TRANSFER.TRANSFER_ORDER_HEADER_MODEL();
                model.INTERNAL_TRANSFER_NUM = entity.INTERNAL_TRANSFER_NUM;
                model.TRANSFER_ID           = entity.TRANSFER_ID;
                model.LEADING_STS           = entity.LEADING_STS;
                model.CART_ID                 = entity.CART_ID;
                model.BEGIN_DATE_TIME         = entity.BEGIN_DATE_TIME;
                model.END_DATE_TIME           = entity.END_DATE_TIME;
                model.CREATED_USER            = entity.CREATED_USER;
                model.CREATED_DATE_TIME       = entity.CREATED_DATE_TIME;
                model.LAST_MODIFIED_USER      = entity.LAST_MODIFIED_USER;
                model.LAST_MODIFIED_DATE_TIME = entity.LAST_MODIFIED_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;
                model.WAREHOUSE               = entity.WAREHOUSE;
                model.COMPANY                 = entity.COMPANY;
                model.TRAILING_STS            = entity.TRAILING_STS;

                return(model);
            }
            else
            {
                return(null);
            }
        }