/// <summary> /// Update a single value immediately with a single service call for fast response time /// </summary> /// <param name="vo"></param> public long InsertUpdateRow(AnnotationVo vo) { if (ServiceFacade.UseRemoteServices) { List <AnnotationVo> voList = new List <AnnotationVo>(); voList.Add(vo); List <ServiceTypes.AnnotationVo> serviceVoList = ServiceFacade.TypeConversionHelper.Convert <List <AnnotationVo>, List <ServiceTypes.AnnotationVo> >(voList); Mobius.Services.Native.INativeSession nativeClient = ServiceFacade.CreateNativeSessionProxy(); Services.Native.NativeMethodTransportObject resultObject = ServiceFacade.InvokeNativeMethod(nativeClient, (int)Services.Native.ServiceCodes.MobiusAnnotationService, (int)Services.Native.ServiceOpCodes.MobiusAnnotationService.InsertUpdateRow, new Services.Native.NativeMethodTransportObject(new object[] { instanceId, serviceVoList })); ((System.ServiceModel.IClientChannel)nativeClient).Close(); long newRsltId = (long)resultObject.Value; return(newRsltId); } else { return(Instance.InsertUpdateRow(vo)); } }
/// <summary> /// Fast insert/update of a single row including creation of the AnnotationDao object, transaction and header update /// </summary> /// <param name="vo"></param> /// <returns></returns> public static long InsertUpdateRowAndUserObjectHeader(AnnotationVo vo) { bool newRow = vo.rslt_id <= 0; AnnotationDao dao = new AnnotationDao(); dao.BeginTransaction(); long rsltId = dao.InsertUpdateRow(vo); dao.Commit(); dao.Dispose(); UserObject uo = UserObjectDao.ReadHeader(vo.mthd_vrsn_id); if (uo != null) { uo.UpdateDateTime = DateTime.Now; if (newRow) { uo.Count++; } UserObjectDao.UpdateHeader(uo); } return(rsltId); }