예제 #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.GSP.GSP_CODE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.GSP_CODE 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.ITEM                       = model.ITEM;
                entity.COMPANY                    = model.COMPANY;
                entity.GSP_CODE1                  = model.GSP_CODE1;
                entity.WAREHOUSE                  = model.WAREHOUSE;
                entity.INTERNAL_SHIPMENT_NUM      = model.INTERNAL_SHIPMENT_NUM;
                entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM;
                entity.SHIPMENT_ID                = model.SHIPMENT_ID;
                entity.SHIP_CONT_ID               = model.SHIP_CONT_ID;
                entity.PARENT_SHIP_CONT_NUM       = model.PARENT_SHIP_CONT_NUM;
                entity.SHIP_CONT_NUM              = model.SHIP_CONT_NUM;
                entity.INTERNAL_RECEIPT_NUM       = model.INTERNAL_RECEIPT_NUM;
                entity.INTERNAL_RECEIPT_LINE_NUM  = model.INTERNAL_RECEIPT_LINE_NUM;
                entity.RECEIPT_ID                 = model.RECEIPT_ID;
                entity.RECV_CONT_ID               = model.RECV_CONT_ID;
                entity.PARENT_RECV_CONT_NUM       = model.PARENT_RECV_CONT_NUM;
                entity.RECV_CONT_NUM              = model.RECV_CONT_NUM;
                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.CREATED_DATE_TIME          = model.CREATED_DATE_TIME;
                entity.CREATED_USER               = model.CREATED_USER;
                entity.LAST_MODIFIED_DATE_TIME    = model.LAST_MODIFIED_DATE_TIME;
                entity.LAST_MODIFIED_USER         = model.LAST_MODIFIED_USER;
                entity.PROCESS_STAMP              = model.PROCESS_STAMP;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.GSP.GSP_CODE_MODEL);
                Type typeE = typeof(Apps.Models.GSP_CODE);
                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);
        }
예제 #2
0
        public virtual Apps.Models.SCV.GSP.GSP_CODE_MODEL GetById(string id)
        {
            Apps.Models.GSP_CODE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //GSP_CODE entity = m_Rep.GetById(id);
                Apps.Models.SCV.GSP.GSP_CODE_MODEL model = new Apps.Models.SCV.GSP.GSP_CODE_MODEL();
                model.INTERNAL_NUM               = entity.INTERNAL_NUM;
                model.ITEM                       = entity.ITEM;
                model.COMPANY                    = entity.COMPANY;
                model.GSP_CODE1                  = entity.GSP_CODE1;
                model.WAREHOUSE                  = entity.WAREHOUSE;
                model.INTERNAL_SHIPMENT_NUM      = entity.INTERNAL_SHIPMENT_NUM;
                model.INTERNAL_SHIPMENT_LINE_NUM = entity.INTERNAL_SHIPMENT_LINE_NUM;
                model.SHIPMENT_ID                = entity.SHIPMENT_ID;
                model.SHIP_CONT_ID               = entity.SHIP_CONT_ID;
                model.PARENT_SHIP_CONT_NUM       = entity.PARENT_SHIP_CONT_NUM;
                model.SHIP_CONT_NUM              = entity.SHIP_CONT_NUM;
                model.INTERNAL_RECEIPT_NUM       = entity.INTERNAL_RECEIPT_NUM;
                model.INTERNAL_RECEIPT_LINE_NUM  = entity.INTERNAL_RECEIPT_LINE_NUM;
                model.RECEIPT_ID                 = entity.RECEIPT_ID;
                model.RECV_CONT_ID               = entity.RECV_CONT_ID;
                model.PARENT_RECV_CONT_NUM       = entity.PARENT_RECV_CONT_NUM;
                model.RECV_CONT_NUM              = entity.RECV_CONT_NUM;
                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.CREATED_DATE_TIME          = entity.CREATED_DATE_TIME;
                model.CREATED_USER               = entity.CREATED_USER;
                model.LAST_MODIFIED_DATE_TIME    = entity.LAST_MODIFIED_DATE_TIME;
                model.LAST_MODIFIED_USER         = entity.LAST_MODIFIED_USER;
                model.PROCESS_STAMP              = entity.PROCESS_STAMP;

                return(model);
            }
            else
            {
                return(null);
            }
        }
예제 #3
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.GSP.GSP_CODE_MODEL model)
        {
            Apps.Models.GSP_CODE entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.GSP_CODE();
            entity.INTERNAL_NUM               = model.INTERNAL_NUM;
            entity.ITEM                       = model.ITEM;
            entity.COMPANY                    = model.COMPANY;
            entity.GSP_CODE1                  = model.GSP_CODE1;
            entity.WAREHOUSE                  = model.WAREHOUSE;
            entity.INTERNAL_SHIPMENT_NUM      = model.INTERNAL_SHIPMENT_NUM;
            entity.INTERNAL_SHIPMENT_LINE_NUM = model.INTERNAL_SHIPMENT_LINE_NUM;
            entity.SHIPMENT_ID                = model.SHIPMENT_ID;
            entity.SHIP_CONT_ID               = model.SHIP_CONT_ID;
            entity.PARENT_SHIP_CONT_NUM       = model.PARENT_SHIP_CONT_NUM;
            entity.SHIP_CONT_NUM              = model.SHIP_CONT_NUM;
            entity.INTERNAL_RECEIPT_NUM       = model.INTERNAL_RECEIPT_NUM;
            entity.INTERNAL_RECEIPT_LINE_NUM  = model.INTERNAL_RECEIPT_LINE_NUM;
            entity.RECEIPT_ID                 = model.RECEIPT_ID;
            entity.RECV_CONT_ID               = model.RECV_CONT_ID;
            entity.PARENT_RECV_CONT_NUM       = model.PARENT_RECV_CONT_NUM;
            entity.RECV_CONT_NUM              = model.RECV_CONT_NUM;
            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.CREATED_DATE_TIME          = model.CREATED_DATE_TIME;
            entity.CREATED_USER               = model.CREATED_USER;
            entity.LAST_MODIFIED_DATE_TIME    = model.LAST_MODIFIED_DATE_TIME;
            entity.LAST_MODIFIED_USER         = model.LAST_MODIFIED_USER;
            entity.PROCESS_STAMP              = model.PROCESS_STAMP;

            m_Rep.Create(entity);
        }