public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.SERIAL.SERIAL_NUMBER_MODEL model, params string[] updateProperties)
        {
            Apps.Models.SERIAL_NUMBER 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.GROUP_ID                   = model.GROUP_ID;
                entity.ITEM                       = model.ITEM;
                entity.COMPANY                    = model.COMPANY;
                entity.SERIAL_NUMBER1             = model.SERIAL_NUMBER1;
                entity.TEMPLATE_ID                = model.TEMPLATE_ID;
                entity.WAREHOUSE                  = model.WAREHOUSE;
                entity.LOCATION                   = model.LOCATION;
                entity.LPN                        = model.LPN;
                entity.LOC_INV_NUM                = model.LOC_INV_NUM;
                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.USER_STAMP                 = model.USER_STAMP;
                entity.PROCESS_STAMP              = model.PROCESS_STAMP;
                entity.DATE_TIME_STAMP            = model.DATE_TIME_STAMP;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.SERIAL.SERIAL_NUMBER_MODEL);
                Type typeE = typeof(Apps.Models.SERIAL_NUMBER);
                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.SERIAL.SERIAL_NUMBER_MODEL GetById(string id)
        {
            Apps.Models.SERIAL_NUMBER entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //SERIAL_NUMBER entity = m_Rep.GetById(id);
                Apps.Models.SCV.SERIAL.SERIAL_NUMBER_MODEL model = new Apps.Models.SCV.SERIAL.SERIAL_NUMBER_MODEL();
                model.INTERNAL_NUM               = entity.INTERNAL_NUM;
                model.GROUP_ID                   = entity.GROUP_ID;
                model.ITEM                       = entity.ITEM;
                model.COMPANY                    = entity.COMPANY;
                model.SERIAL_NUMBER1             = entity.SERIAL_NUMBER1;
                model.TEMPLATE_ID                = entity.TEMPLATE_ID;
                model.WAREHOUSE                  = entity.WAREHOUSE;
                model.LOCATION                   = entity.LOCATION;
                model.LPN                        = entity.LPN;
                model.LOC_INV_NUM                = entity.LOC_INV_NUM;
                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.USER_STAMP                 = entity.USER_STAMP;
                model.PROCESS_STAMP              = entity.PROCESS_STAMP;
                model.DATE_TIME_STAMP            = entity.DATE_TIME_STAMP;

                return(model);
            }
            else
            {
                return(null);
            }
        }
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.SERIAL.SERIAL_NUMBER_MODEL model)
        {
            Apps.Models.SERIAL_NUMBER entity = m_Rep.GetById(model.INTERNAL_NUM);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.SERIAL_NUMBER();
            entity.INTERNAL_NUM               = model.INTERNAL_NUM;
            entity.GROUP_ID                   = model.GROUP_ID;
            entity.ITEM                       = model.ITEM;
            entity.COMPANY                    = model.COMPANY;
            entity.SERIAL_NUMBER1             = model.SERIAL_NUMBER1;
            entity.TEMPLATE_ID                = model.TEMPLATE_ID;
            entity.WAREHOUSE                  = model.WAREHOUSE;
            entity.LOCATION                   = model.LOCATION;
            entity.LPN                        = model.LPN;
            entity.LOC_INV_NUM                = model.LOC_INV_NUM;
            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.USER_STAMP                 = model.USER_STAMP;
            entity.PROCESS_STAMP              = model.PROCESS_STAMP;
            entity.DATE_TIME_STAMP            = model.DATE_TIME_STAMP;

            m_Rep.Create(entity);
        }