public virtual Apps.Models.SCV.ITEM.ITEM_ZONE_CAPACITY_MODEL GetById(string id) { Apps.Models.ITEM_ZONE_CAPACITY entity = m_Rep.GetById(id); if (entity != null) { //ITEM_ZONE_CAPACITY entity = m_Rep.GetById(id); Apps.Models.SCV.ITEM.ITEM_ZONE_CAPACITY_MODEL model = new Apps.Models.SCV.ITEM.ITEM_ZONE_CAPACITY_MODEL(); model.INTERNAL_ITEM_ZONE_NUM = entity.INTERNAL_ITEM_ZONE_NUM; model.COMPANY = entity.COMPANY; model.ITEM = entity.ITEM; model.LOCATION_SEL = entity.LOCATION_SEL; model.MAXIMUM_QTY = entity.MAXIMUM_QTY; model.MINIMUM_QTY = entity.MINIMUM_QTY; model.QUANTITY_UM = entity.QUANTITY_UM; model.MINIMUM_RPLN_PCT = entity.MINIMUM_RPLN_PCT; model.USER_STAMP = entity.USER_STAMP; model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.ITEM.ITEM_ZONE_CAPACITY_MODEL model) { Apps.Models.ITEM_ZONE_CAPACITY entity = m_Rep.GetById(model.INTERNAL_ITEM_ZONE_NUM); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.ITEM_ZONE_CAPACITY(); entity.INTERNAL_ITEM_ZONE_NUM = model.INTERNAL_ITEM_ZONE_NUM; entity.COMPANY = model.COMPANY; entity.ITEM = model.ITEM; entity.LOCATION_SEL = model.LOCATION_SEL; entity.MAXIMUM_QTY = model.MAXIMUM_QTY; entity.MINIMUM_QTY = model.MINIMUM_QTY; entity.QUANTITY_UM = model.QUANTITY_UM; entity.MINIMUM_RPLN_PCT = model.MINIMUM_RPLN_PCT; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.ITEM.ITEM_ZONE_CAPACITY_MODEL model, params string[] updateProperties) { Apps.Models.ITEM_ZONE_CAPACITY entity = m_Rep.GetById(model.INTERNAL_ITEM_ZONE_NUM); if (entity == null) { errors.Add(Resource.Disable); return; } if (updateProperties.Count() <= 0) { entity.INTERNAL_ITEM_ZONE_NUM = model.INTERNAL_ITEM_ZONE_NUM; entity.COMPANY = model.COMPANY; entity.ITEM = model.ITEM; entity.LOCATION_SEL = model.LOCATION_SEL; entity.MAXIMUM_QTY = model.MAXIMUM_QTY; entity.MINIMUM_QTY = model.MINIMUM_QTY; entity.QUANTITY_UM = model.QUANTITY_UM; entity.MINIMUM_RPLN_PCT = model.MINIMUM_RPLN_PCT; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; } else { Type type = typeof(Apps.Models.SCV.ITEM.ITEM_ZONE_CAPACITY_MODEL); Type typeE = typeof(Apps.Models.ITEM_ZONE_CAPACITY); 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); }