public long m_lngSave(clsApplyUnitPropertyDoc p_objDoc) { long lngRes = 0; clsApplyUnitPropertyDoc objDocOut = null; com.digitalwave.iCare.middletier.LIS.clsApplyPropertySv objSvc = (com.digitalwave.iCare.middletier.LIS.clsApplyPropertySv)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType( typeof(com.digitalwave.iCare.middletier.LIS.clsApplyPropertySv)); lngRes = objSvc.m_lngSavePropertyAndValue(objPrincipal, p_objDoc, out objDocOut); return(lngRes); }
public long m_lngConstructDoc(out clsApplyUnitPropertyDoc p_objDoc) { p_objDoc = null; clsUnitProperty_VO[] objPropertyArr; clsUnitPropertyValue_VO[] objValueArr; long lngRes = m_lngGetAllUnitPropertyData(out objPropertyArr, out objValueArr); if (lngRes <= 0) { return(lngRes); } p_objDoc = new clsApplyUnitPropertyDoc(); Hashtable hasPorperty = new Hashtable(); if (objPropertyArr != null) { foreach (clsUnitProperty_VO objPropertyVO in objPropertyArr) { clsApplyUnitProperty objProperty = new clsApplyUnitProperty(); objProperty.PropertyVO = objPropertyVO; objProperty.State = enmRecordState.Original; p_objDoc.Properties.Add(objProperty); if (!hasPorperty.ContainsKey(objPropertyVO.m_strPROPERTY_ID_CHR)) { hasPorperty.Add(objPropertyVO.m_strPROPERTY_ID_CHR, objProperty); } } } if (objValueArr != null) { foreach (clsUnitPropertyValue_VO objValueVO in objValueArr) { clsPropertyValue objValue = new clsPropertyValue(); objValue.ValueVO = objValueVO; objValue.State = enmRecordState.Original; if (hasPorperty.ContainsKey(objValueVO.m_strPROPERTY_ID_CHR)) { ((clsApplyUnitProperty)hasPorperty[objValueVO.m_strPROPERTY_ID_CHR]).Values.Add(objValue); } } } return(lngRes); }
public long m_lngSavePropertyAndValue(System.Security.Principal.IPrincipal p_objPrincipal, clsApplyUnitPropertyDoc p_objDoc, out clsApplyUnitPropertyDoc p_objOutDoc) { p_objOutDoc = p_objDoc; long lngRes = 1; if (p_objDoc == null) { return(1); } try { foreach (clsApplyUnitProperty objProperty in p_objDoc.Properties) { switch (objProperty.State) { case enmRecordState.New: lngRes = m_lngAddProperty(objProperty.PropertyVO); break; case enmRecordState.Modify: lngRes = m_lngUpdateProperty(objProperty.PropertyVO); break; default: break; } if (lngRes <= 0) { break; } foreach (clsPropertyValue objValue in objProperty.Values) { switch (objValue.State) { case enmRecordState.New: objValue.ValueVO.m_strPROPERTY_ID_CHR = objProperty.PropertyVO.m_strPROPERTY_ID_CHR; lngRes = m_lngAddPropertyValue(objValue.ValueVO); break; case enmRecordState.Modify: lngRes = m_lngUpdatePropertyValue(objValue.ValueVO); break; default: break; } if (lngRes <= 0) { break; } } if (lngRes <= 0) { break; } } } catch {} if (lngRes <= 0) { System.EnterpriseServices.ContextUtil.SetAbort(); } return(lngRes); }