Example #1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_BARCODE_MODEL model, params string[] updateProperties)
        {
            Apps.Models.DOWNLOAD_ITEM_BARCODE 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.PROCESS_STAMP         = model.PROCESS_STAMP;
                entity.ITEM        = model.ITEM;
                entity.COMPANY     = model.COMPANY;
                entity.BARCODE     = model.BARCODE;
                entity.QUANTITY_UM = model.QUANTITY_UM;
                entity.ACTIVE      = model.ACTIVE;
            }
            else
            {
                Type type  = typeof(Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_BARCODE_MODEL);
                Type typeE = typeof(Apps.Models.DOWNLOAD_ITEM_BARCODE);
                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);
        }
Example #2
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_BARCODE_MODEL model)
        {
            Apps.Models.DOWNLOAD_ITEM_BARCODE entity = m_Rep.GetById(model.INTERFACE_RECORD_ID);
            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity = new Apps.Models.DOWNLOAD_ITEM_BARCODE();
            entity.INTERFACE_RECORD_ID   = model.INTERFACE_RECORD_ID;
            entity.INTERFACE_ACTION_CODE = model.INTERFACE_ACTION_CODE;
            entity.INTERFACE_CONDITION   = model.INTERFACE_CONDITION;
            entity.PROCESS_STAMP         = model.PROCESS_STAMP;
            entity.ITEM        = model.ITEM;
            entity.COMPANY     = model.COMPANY;
            entity.BARCODE     = model.BARCODE;
            entity.QUANTITY_UM = model.QUANTITY_UM;
            entity.ACTIVE      = model.ACTIVE;

            m_Rep.Create(entity);
        }
Example #3
0
        public virtual Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_BARCODE_MODEL GetById(string id)
        {
            Apps.Models.DOWNLOAD_ITEM_BARCODE entity = m_Rep.GetById(id);
            if (entity != null)
            {
                //DOWNLOAD_ITEM_BARCODE entity = m_Rep.GetById(id);
                Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_BARCODE_MODEL model = new Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_BARCODE_MODEL();
                model.INTERFACE_RECORD_ID   = entity.INTERFACE_RECORD_ID;
                model.INTERFACE_ACTION_CODE = entity.INTERFACE_ACTION_CODE;
                model.INTERFACE_CONDITION   = entity.INTERFACE_CONDITION;
                model.PROCESS_STAMP         = entity.PROCESS_STAMP;
                model.ITEM        = entity.ITEM;
                model.COMPANY     = entity.COMPANY;
                model.BARCODE     = entity.BARCODE;
                model.QUANTITY_UM = entity.QUANTITY_UM;
                model.ACTIVE      = entity.ACTIVE;

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