public virtual Apps.Models.SCV.UPLOAD.UPLOAD_INVENTORY_TRANS_MODEL GetById(string id)
        {
            Apps.Models.UPLOAD_INVENTORY_TRANS entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //UPLOAD_INVENTORY_TRANS entity = m_Rep.GetById(id);
                Apps.Models.SCV.UPLOAD.UPLOAD_INVENTORY_TRANS_MODEL model = new Apps.Models.SCV.UPLOAD.UPLOAD_INVENTORY_TRANS_MODEL();
                model.INTERFACE_RECORD_ID   = entity.INTERFACE_RECORD_ID;
                model.INTERFACE_ACTION_CODE = entity.INTERFACE_ACTION_CODE;
                model.INTERFACE_CONDITION   = entity.INTERFACE_CONDITION;
                model.INTERFACE_ERROR       = entity.INTERFACE_ERROR;
                model.PROCESS_STAMP         = entity.PROCESS_STAMP;
                model.COMPANY            = entity.COMPANY;
                model.ITEM               = entity.ITEM;
                model.LOCATION           = entity.LOCATION;
                model.ATTRIBUTE1         = entity.ATTRIBUTE1;
                model.ATTRIBUTE2         = entity.ATTRIBUTE2;
                model.ATTRIBUTE3         = entity.ATTRIBUTE3;
                model.ATTRIBUTE4         = entity.ATTRIBUTE4;
                model.ATTRIBUTE5         = entity.ATTRIBUTE5;
                model.ATTRIBUTE6         = entity.ATTRIBUTE6;
                model.ATTRIBUTE7         = entity.ATTRIBUTE7;
                model.ATTRIBUTE8         = entity.ATTRIBUTE8;
                model.QUANTITY           = entity.QUANTITY;
                model.QUANTITY_UM        = entity.QUANTITY_UM;
                model.REFERENCE_ID       = entity.REFERENCE_ID;
                model.REFERENCE_LINE_NUM = entity.REFERENCE_LINE_NUM;
                model.REFERENCE_TYPE     = entity.REFERENCE_TYPE;
                model.REFERENCE_NUM_TYPE = entity.REFERENCE_NUM_TYPE;
                model.TRANSACTION_TYPE   = entity.TRANSACTION_TYPE;
                model.USER_STAMP         = entity.USER_STAMP;
                model.WAREHOUSE          = entity.WAREHOUSE;
                model.ZONE               = entity.ZONE;
                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.DATE_TIME_STAMP    = entity.DATE_TIME_STAMP;
                model.ACTIVITY_DATE_TIME = entity.ACTIVITY_DATE_TIME;
                model.DIRECTION          = entity.DIRECTION;
                model.LPN = entity.LPN;
                model.BEFORE_INVENTORY_STS = entity.BEFORE_INVENTORY_STS;
                model.AFTER_INVENTORY_STS  = entity.AFTER_INVENTORY_STS;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.UPLOAD.UPLOAD_INVENTORY_TRANS_MODEL model)
        {
            Apps.Models.UPLOAD_INVENTORY_TRANS entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.UPLOAD_INVENTORY_TRANS();
            entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
            entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
            entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
            entity.INTERFACE_ERROR       = model.INTERFACE_ERROR;
            entity.PROCESS_STAMP         = model.PROCESS_STAMP;
            entity.COMPANY            = model.COMPANY;
            entity.ITEM               = model.ITEM;
            entity.LOCATION           = model.LOCATION;
            entity.ATTRIBUTE1         = model.ATTRIBUTE1;
            entity.ATTRIBUTE2         = model.ATTRIBUTE2;
            entity.ATTRIBUTE3         = model.ATTRIBUTE3;
            entity.ATTRIBUTE4         = model.ATTRIBUTE4;
            entity.ATTRIBUTE5         = model.ATTRIBUTE5;
            entity.ATTRIBUTE6         = model.ATTRIBUTE6;
            entity.ATTRIBUTE7         = model.ATTRIBUTE7;
            entity.ATTRIBUTE8         = model.ATTRIBUTE8;
            entity.QUANTITY           = model.QUANTITY;
            entity.QUANTITY_UM        = model.QUANTITY_UM;
            entity.REFERENCE_ID       = model.REFERENCE_ID;
            entity.REFERENCE_LINE_NUM = model.REFERENCE_LINE_NUM;
            entity.REFERENCE_TYPE     = model.REFERENCE_TYPE;
            entity.REFERENCE_NUM_TYPE = model.REFERENCE_NUM_TYPE;
            entity.TRANSACTION_TYPE   = model.TRANSACTION_TYPE;
            entity.USER_STAMP         = model.USER_STAMP;
            entity.WAREHOUSE          = model.WAREHOUSE;
            entity.ZONE               = model.ZONE;
            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.DATE_TIME_STAMP    = model.DATE_TIME_STAMP;
            entity.ACTIVITY_DATE_TIME = model.ACTIVITY_DATE_TIME;
            entity.DIRECTION          = model.DIRECTION;
            entity.LPN = model.LPN;
            entity.BEFORE_INVENTORY_STS = model.BEFORE_INVENTORY_STS;
            entity.AFTER_INVENTORY_STS  = model.AFTER_INVENTORY_STS;

            m_Rep.Create(entity);
        }
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.UPLOAD.UPLOAD_INVENTORY_TRANS_MODEL model, params string[] updateProperties)
        {
            Apps.Models.UPLOAD_INVENTORY_TRANS entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
                entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
                entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
                entity.INTERFACE_ERROR       = model.INTERFACE_ERROR;
                entity.PROCESS_STAMP         = model.PROCESS_STAMP;
                entity.COMPANY            = model.COMPANY;
                entity.ITEM               = model.ITEM;
                entity.LOCATION           = model.LOCATION;
                entity.ATTRIBUTE1         = model.ATTRIBUTE1;
                entity.ATTRIBUTE2         = model.ATTRIBUTE2;
                entity.ATTRIBUTE3         = model.ATTRIBUTE3;
                entity.ATTRIBUTE4         = model.ATTRIBUTE4;
                entity.ATTRIBUTE5         = model.ATTRIBUTE5;
                entity.ATTRIBUTE6         = model.ATTRIBUTE6;
                entity.ATTRIBUTE7         = model.ATTRIBUTE7;
                entity.ATTRIBUTE8         = model.ATTRIBUTE8;
                entity.QUANTITY           = model.QUANTITY;
                entity.QUANTITY_UM        = model.QUANTITY_UM;
                entity.REFERENCE_ID       = model.REFERENCE_ID;
                entity.REFERENCE_LINE_NUM = model.REFERENCE_LINE_NUM;
                entity.REFERENCE_TYPE     = model.REFERENCE_TYPE;
                entity.REFERENCE_NUM_TYPE = model.REFERENCE_NUM_TYPE;
                entity.TRANSACTION_TYPE   = model.TRANSACTION_TYPE;
                entity.USER_STAMP         = model.USER_STAMP;
                entity.WAREHOUSE          = model.WAREHOUSE;
                entity.ZONE               = model.ZONE;
                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.DATE_TIME_STAMP    = model.DATE_TIME_STAMP;
                entity.ACTIVITY_DATE_TIME = model.ACTIVITY_DATE_TIME;
                entity.DIRECTION          = model.DIRECTION;
                entity.LPN = model.LPN;
                entity.BEFORE_INVENTORY_STS = model.BEFORE_INVENTORY_STS;
                entity.AFTER_INVENTORY_STS  = model.AFTER_INVENTORY_STS;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.UPLOAD.UPLOAD_INVENTORY_TRANS_MODEL);
                Type typeE = typeof(Apps.Models.UPLOAD_INVENTORY_TRANS);
                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);
        }