当前位置: 首页>>代码示例>>C#>>正文


C# UnitOfWork.BeginNestedUnitOfWork方法代码示例

本文整理汇总了C#中UnitOfWork.BeginNestedUnitOfWork方法的典型用法代码示例。如果您正苦于以下问题:C# UnitOfWork.BeginNestedUnitOfWork方法的具体用法?C# UnitOfWork.BeginNestedUnitOfWork怎么用?C# UnitOfWork.BeginNestedUnitOfWork使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnitOfWork的用法示例。


在下文中一共展示了UnitOfWork.BeginNestedUnitOfWork方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FrmCrearEmpleado

 public FrmCrearEmpleado(Empleado empleado, XPCollection xpcEmpleado, XPCollection xpcDepartamento, XPCollection xpcTipoNomina, XPCollection xpcPuesto, XPCollection xpcTipoEmpleado, XPCollection xpcGrupoEmpleado, XPCollection xpcPercepcion, XPCollection xpcDeduccion, XPCollection xpcConcepto,XPCollection xpcCuentaContable, UnitOfWork uow)
     : this()
 {
     this.Empleado = empleado;
     this.uow = uow;
     this.xpcEmpleado = xpcEmpleado;
     this.xpcDepartamento = xpcDepartamento;
     this.xpcTipoNomina = xpcTipoNomina;
     this.xpcPuesto = xpcPuesto;
     this.xpcTipoEmpleado = xpcTipoEmpleado;
     this.xpcGrupoEmpleado = xpcGrupoEmpleado;
     this.xpcPercepcion = xpcPercepcion;
     this.xpcDeduccion = xpcDeduccion;
     this.xpcDepartamento.Session = uow;
     this.xpcTipoNomina.Session = uow;
     this.xpcPuesto.Session = uow;
     this.xpcTipoEmpleado.Session = uow;
     this.xpcGrupoEmpleado.Session = uow;
     this.xpcPercepcion.Session = uow;
     this.xpcDeduccion.Session = uow;
     this.xpcConcepto = xpcConcepto;
     this.xpcConcepto.Session = uow;
     this.xpcCuentaContable = xpcCuentaContable;
     this.xpcCuentaContable.Session = uow;
     this.uowAnidada = uow.BeginNestedUnitOfWork();
     this.xpcConceptoAnidada = new XPCollection(uowAnidada, xpcConcepto);
     this.xpcPercepcionAnidada = new XPCollection(uowAnidada, xpcPercepcion, new GroupOperator(GroupOperatorType.And, new BinaryOperator("Empleado", empleado, BinaryOperatorType.Equal)));
     xpcPercepcionAnidada.DisplayableProperties = "This;Concepto.Descripcion;Importe;Referencia;Referencia1";
     this.xpcCuentaContableAnidada = new XPCollection(uowAnidada, xpcCuentaContable);
     ///xpcCuentaContableAnidada.DisplayableProperties = "This;Concepto.Descripcion;Importe;Referencia;Referencia1";
     gridPercepcion.DataSource = xpcPercepcionAnidada;
     grdPercepcion.Columns.Clear();
     grdPercepcion.Columns.AddVisible("Concepto.Descripcion", "Concepto");
     grdPercepcion.Columns.AddVisible("Importe", "Importe");
     grdPercepcion.Columns.AddVisible("Referencia", "Referencia");
     grdPercepcion.Columns.AddVisible("Referencia1", "Referencia1");
     grdPercepcion.BestFitColumns();
     this.xpcDeduccionAnidada = new XPCollection(uowAnidada, xpcDeduccion, new GroupOperator(GroupOperatorType.And, new BinaryOperator("Empleado", empleado, BinaryOperatorType.Equal)));
     xpcDeduccionAnidada.DisplayableProperties = "This;Concepto.Descripcion;Fecha;Importe;Descuento;Adeudo;Referencia;Referencia1;CuentaContable.Descripcion";
     gridDeduccion.DataSource = xpcDeduccionAnidada;
     grdDeduccion.Columns.Clear();
     grdDeduccion.Columns.AddVisible("Concepto.Descripcion","Concepto");
     grdDeduccion.Columns.AddVisible("Fecha", "Fecha");
     grdDeduccion.Columns.AddVisible("Importe", "Importe");
     grdDeduccion.Columns.AddVisible("Descuento", "Descuento");
     grdDeduccion.Columns.AddVisible("Adeudo", "Adeudo");
     grdDeduccion.Columns.AddVisible("Referencia", "Referencia");
     grdDeduccion.BestFitColumns();
     RellenarCombos();
 }
开发者ID:jmurataya,项目名称:Nomina,代码行数:50,代码来源:FrmCrearEmpleado.cs

示例2: ImportObjects

 public int ImportObjects(XDocument document, UnitOfWork unitOfWork) {
     if (document.Root != null){
         foreach (XElement element in document.Root.Nodes().OfType<XElement>()){
             using (var nestedUnitOfWork = unitOfWork.BeginNestedUnitOfWork()){
                 ITypeInfo typeInfo = GetTypeInfo(element);
                 IEnumerable<XElement> elements = element.Descendants("Property");
                 var xElements = elements.Where(xElement => xElement.GetAttributeValue("isKey").MakeFirstCharUpper() == true.ToString());
                 CriteriaOperator objectKeyCriteria = GetObjectKeyCriteria(typeInfo, xElements);
                 CreateObject(element, nestedUnitOfWork, typeInfo, objectKeyCriteria);
                 nestedUnitOfWork.CommitChanges();
             }
         }
         unitOfWork.CommitChanges();
     }
     return 0;
 }
开发者ID:gvilas,项目名称:eXpand,代码行数:16,代码来源:ImportEngine.cs

示例3: ImportObjects

 int ImportObjects(XDocument document, UnitOfWork unitOfWork) {
     _unitOfWork = unitOfWork;
     if (document.Root != null) {
         foreach (XElement element in document.Root.Nodes().OfType<XElement>()) {
             using (NestedUnitOfWork nestedUnitOfWork = unitOfWork.BeginNestedUnitOfWork()) {
                 ITypeInfo typeInfo = GetTypeInfo(element);
                 if (typeInfo != null) {
                     var keys = GetKeys(element);
                     CriteriaOperator objectKeyCriteria = GetObjectKeyCriteria(typeInfo, keys);
                     if (!ReferenceEquals(objectKeyCriteria, null)) {
                         CreateObject(element, nestedUnitOfWork, typeInfo, objectKeyCriteria);
                         nestedUnitOfWork.CommitChanges();
                     }
                 }
             }
         }
         unitOfWork.CommitChanges();
     }
     return 0;
 }
开发者ID:aries544,项目名称:eXpand,代码行数:20,代码来源:ImportEngine.cs

示例4: FrmCrearConcepto

 public FrmCrearConcepto(Concepto concepto, XPCollection xpcConcepto, UnitOfWork uow,XPCollection xpcCuentaContable,XPCollection xpcPercepcionBase,XPCollection xpcConceptoDetalle)
     : this()
 {
     this.uow = uow;
     this.uowAnidada = uow.BeginNestedUnitOfWork();
     this.xpcCuentaContable = xpcCuentaContable;
     this.xpcCuentaContable.Session = uow;
     this.Concepto = concepto;
     this.xpcConcepto = xpcConcepto;
     this.xpcConcepto.Session = uow;
     this.xpcPercepcionBase = xpcPercepcionBase;
     this.xpcPercepcionBase.Session = uow;
     this.xpcConceptoDetalle = xpcConceptoDetalle;
     this.xpcConceptoDetalle.Session = uow;
     xpcConceptoDetalleAnidada = new XPCollection(uowAnidada, xpcConceptoDetalle, new GroupOperator(GroupOperatorType.And, new BinaryOperator("Concepto", concepto, BinaryOperatorType.Equal)));
     xpcConceptoDetalleAnidada.DisplayableProperties="This;PercepcionBase.Descripcion";
     lkpCuentaContable.Properties.DataSource = xpcCuentaContable;
     lkpCuentaContable.Properties.ValueMember = "This";
     lkpCuentaContable.Properties.DisplayMember = "Cuenta";
     gridConceptoDetalle.DataSource = xpcConceptoDetalleAnidada;
     grdConceptoDetalle.Columns.Clear();
     grdConceptoDetalle.Columns.AddVisible("PercepcionBase.Descripcion");
 }
开发者ID:jmurataya,项目名称:Nomina,代码行数:23,代码来源:FrmCrearConcepto.cs


注:本文中的UnitOfWork.BeginNestedUnitOfWork方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。