Exemplo n.º 1
0
        public virtual void Modify(ref ValidationErrors errors, Apps.Models.Spm.Spm_LastTimeModel model, params string[] updateProperties)
        {
            Spm_LastTime entity = m_Rep.GetById(model.Id);

            if (entity == null)
            {
                errors.Add(Resource.Disable);
                return;
            }
            if (updateProperties.Count() <= 0)
            {
                entity.Id = model.Id;
                entity.ActualShipDateTime = model.ActualShipDateTime;
                entity.Kd100Flag          = model.Kd100Flag;
            }
            else
            {
                Type type  = typeof(Apps.Models.Spm.Spm_LastTimeModel);
                Type typeE = typeof(Apps.Models.Spm_LastTime);
                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);
        }
Exemplo n.º 2
0
        public virtual void Create(ref ValidationErrors errors, Apps.Models.Spm.Spm_LastTimeModel model)
        {
            Spm_LastTime entity = m_Rep.GetById(model.Id);

            if (entity != null)
            {
                errors.Add(Resource.PrimaryRepeat);
                return;
            }
            entity    = new Spm_LastTime();
            entity.Id = model.Id;
            entity.ActualShipDateTime = model.ActualShipDateTime;
            entity.Kd100Flag          = model.Kd100Flag;

            m_Rep.Create(entity);
        }
Exemplo n.º 3
0
        public virtual Apps.Models.Spm.Spm_LastTimeModel GetById(string id)
        {
            Spm_LastTime entity = m_Rep.GetById(id);

            if (entity != null)
            {
                //Spm_LastTime entity = m_Rep.GetById(id);
                Apps.Models.Spm.Spm_LastTimeModel model = new Apps.Models.Spm.Spm_LastTimeModel();
                model.Id = entity.Id;
                model.ActualShipDateTime = entity.ActualShipDateTime;
                model.Kd100Flag          = entity.Kd100Flag;

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