Exemplo n.º 1
0
 private void btnSave_ItemClick(object sender, ItemClickEventArgs e)
 {
     DisableButtons();
     try {
         UOW.CommitChanges();
         Order order = (Order)OrdersBindingSource.DataSource;
         Order = UOW.GetParentObject(order);
         Close();
     } finally { EnableButtons(); }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Casts the reference to parent.
        /// </summary>
        /// <param name="nestedUnitOfWork">The nested unit of work.</param>
        /// <param name="source">The source.</param>
        /// <returns></returns>
        private object castReferenceToParent(NestedUnitOfWork nestedUnitOfWork, object source)
        {
            var result = source;

            if (source != null && source is IXPObject)
            {
                if ((source as IXPObject).Session != nestedUnitOfWork.Parent)
                {
                    result = nestedUnitOfWork.GetParentObject(source);
                }
            }
            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Casts the reference to parent.
 /// </summary>
 /// <param name="nestedUnitOfWork">The nested unit of work.</param>
 /// <param name="source">The source.</param>
 /// <returns></returns>
 private object castReferenceToParent(NestedUnitOfWork nestedUnitOfWork, object source)
 {
     var result = source;
     if(source != null && source is IXPObject)
     {
         if ((source as IXPObject).Session != nestedUnitOfWork.Parent)
             result = nestedUnitOfWork.GetParentObject(source);
     }
     return result;
 }