public virtual Apps.Models.SCV.MISC.MISC_INVENTORY_HANDLING_MODEL GetById(string id) { Apps.Models.MISC_INVENTORY_HANDLING entity = m_Rep.GetById(id); if (entity != null) { //MISC_INVENTORY_HANDLING entity = m_Rep.GetById(id); Apps.Models.SCV.MISC.MISC_INVENTORY_HANDLING_MODEL model = new Apps.Models.SCV.MISC.MISC_INVENTORY_HANDLING_MODEL(); model.INTERNAL_NUM = entity.INTERNAL_NUM; model.BATCH_ID = entity.BATCH_ID; model.ERROR_TYPE = entity.ERROR_TYPE; model.CART_ID = entity.CART_ID; model.CART_POS = entity.CART_POS; model.STATUS = entity.STATUS; model.WAREHOUSE = entity.WAREHOUSE; model.COMPANY = entity.COMPANY; model.ITEM = entity.ITEM; model.ITEM_DESC = entity.ITEM_DESC; model.ATTRIBUTE_NUM = entity.ATTRIBUTE_NUM; model.ATTRIBUTE1 = entity.ATTRIBUTE1; model.ATTRIBUTE2 = entity.ATTRIBUTE2; model.ATTRIBUTE3 = entity.ATTRIBUTE3; model.ATTRIBUTE4 = entity.ATTRIBUTE4; model.ATTRIBUTE5 = entity.ATTRIBUTE5; model.ATTRIBUTE6 = entity.ATTRIBUTE6; model.ATTRIBUTE7 = entity.ATTRIBUTE7; model.ATTRIBUTE8 = entity.ATTRIBUTE8; model.QUANTITY = entity.QUANTITY; model.FROM_LOC = entity.FROM_LOC; model.TO_LOC = entity.TO_LOC; model.REFERENCE_TYPE = entity.REFERENCE_TYPE; model.REFERNCE_ID = entity.REFERNCE_ID; model.REFERENCE_NUM = entity.REFERENCE_NUM; model.REFERENCE_LINE_NUM = entity.REFERENCE_LINE_NUM; model.REFERENCE_CONT_ID = entity.REFERENCE_CONT_ID; model.REFERENCE_CONT_NUM = entity.REFERENCE_CONT_NUM; model.CHECKIN_USER = entity.CHECKIN_USER; model.PUTAWAY_USER = entity.PUTAWAY_USER; model.PICK_USER = entity.PICK_USER; model.REBIN_USER = entity.REBIN_USER; model.QC_USER = entity.QC_USER; model.CREATE_USER = entity.CREATE_USER; model.CREATE_DATE_TIME = entity.CREATE_DATE_TIME; model.USER_STAMP = entity.USER_STAMP; model.DATE_TIME_STAMP = entity.DATE_TIME_STAMP; 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; return(model); } else { return(null); } }
public virtual void Create(ref ValidationErrors errors, Apps.Models.SCV.MISC.MISC_INVENTORY_HANDLING_MODEL model) { Apps.Models.MISC_INVENTORY_HANDLING entity = m_Rep.GetById(model.INTERNAL_NUM); if (entity != null) { errors.Add(Resource.PrimaryRepeat); return; } entity = new Apps.Models.MISC_INVENTORY_HANDLING(); entity.INTERNAL_NUM = model.INTERNAL_NUM; entity.BATCH_ID = model.BATCH_ID; entity.ERROR_TYPE = model.ERROR_TYPE; entity.CART_ID = model.CART_ID; entity.CART_POS = model.CART_POS; entity.STATUS = model.STATUS; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.ITEM = model.ITEM; entity.ITEM_DESC = model.ITEM_DESC; entity.ATTRIBUTE_NUM = model.ATTRIBUTE_NUM; entity.ATTRIBUTE1 = model.ATTRIBUTE1; entity.ATTRIBUTE2 = model.ATTRIBUTE2; entity.ATTRIBUTE3 = model.ATTRIBUTE3; entity.ATTRIBUTE4 = model.ATTRIBUTE4; entity.ATTRIBUTE5 = model.ATTRIBUTE5; entity.ATTRIBUTE6 = model.ATTRIBUTE6; entity.ATTRIBUTE7 = model.ATTRIBUTE7; entity.ATTRIBUTE8 = model.ATTRIBUTE8; entity.QUANTITY = model.QUANTITY; entity.FROM_LOC = model.FROM_LOC; entity.TO_LOC = model.TO_LOC; entity.REFERENCE_TYPE = model.REFERENCE_TYPE; entity.REFERNCE_ID = model.REFERNCE_ID; entity.REFERENCE_NUM = model.REFERENCE_NUM; entity.REFERENCE_LINE_NUM = model.REFERENCE_LINE_NUM; entity.REFERENCE_CONT_ID = model.REFERENCE_CONT_ID; entity.REFERENCE_CONT_NUM = model.REFERENCE_CONT_NUM; entity.CHECKIN_USER = model.CHECKIN_USER; entity.PUTAWAY_USER = model.PUTAWAY_USER; entity.PICK_USER = model.PICK_USER; entity.REBIN_USER = model.REBIN_USER; entity.QC_USER = model.QC_USER; entity.CREATE_USER = model.CREATE_USER; entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; 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; m_Rep.Create(entity); }
public virtual void Modify(ref ValidationErrors errors, Apps.Models.SCV.MISC.MISC_INVENTORY_HANDLING_MODEL model, params string[] updateProperties) { Apps.Models.MISC_INVENTORY_HANDLING 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.BATCH_ID = model.BATCH_ID; entity.ERROR_TYPE = model.ERROR_TYPE; entity.CART_ID = model.CART_ID; entity.CART_POS = model.CART_POS; entity.STATUS = model.STATUS; entity.WAREHOUSE = model.WAREHOUSE; entity.COMPANY = model.COMPANY; entity.ITEM = model.ITEM; entity.ITEM_DESC = model.ITEM_DESC; entity.ATTRIBUTE_NUM = model.ATTRIBUTE_NUM; entity.ATTRIBUTE1 = model.ATTRIBUTE1; entity.ATTRIBUTE2 = model.ATTRIBUTE2; entity.ATTRIBUTE3 = model.ATTRIBUTE3; entity.ATTRIBUTE4 = model.ATTRIBUTE4; entity.ATTRIBUTE5 = model.ATTRIBUTE5; entity.ATTRIBUTE6 = model.ATTRIBUTE6; entity.ATTRIBUTE7 = model.ATTRIBUTE7; entity.ATTRIBUTE8 = model.ATTRIBUTE8; entity.QUANTITY = model.QUANTITY; entity.FROM_LOC = model.FROM_LOC; entity.TO_LOC = model.TO_LOC; entity.REFERENCE_TYPE = model.REFERENCE_TYPE; entity.REFERNCE_ID = model.REFERNCE_ID; entity.REFERENCE_NUM = model.REFERENCE_NUM; entity.REFERENCE_LINE_NUM = model.REFERENCE_LINE_NUM; entity.REFERENCE_CONT_ID = model.REFERENCE_CONT_ID; entity.REFERENCE_CONT_NUM = model.REFERENCE_CONT_NUM; entity.CHECKIN_USER = model.CHECKIN_USER; entity.PUTAWAY_USER = model.PUTAWAY_USER; entity.PICK_USER = model.PICK_USER; entity.REBIN_USER = model.REBIN_USER; entity.QC_USER = model.QC_USER; entity.CREATE_USER = model.CREATE_USER; entity.CREATE_DATE_TIME = model.CREATE_DATE_TIME; entity.USER_STAMP = model.USER_STAMP; entity.DATE_TIME_STAMP = model.DATE_TIME_STAMP; 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; } else { Type type = typeof(Apps.Models.SCV.MISC.MISC_INVENTORY_HANDLING_MODEL); Type typeE = typeof(Apps.Models.MISC_INVENTORY_HANDLING); 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); }