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); }
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); }
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); } }