예제 #1
0
        private void DataPortal_Delete(CriteriaCs criteria)
        {
            try
            {
                SessionCode = OpenSession();
                BeginTransaction();

                //Si no hay integridad referencial, aquí se deben borrar las listas hijo
                CriteriaEx criterio = GetCriteria();
                criterio.AddOidSearch(criteria.Oid);

                moleQule.Store.Data.ShippingCompanyRecord obj = (moleQule.Store.Data.ShippingCompanyRecord)(criterio.UniqueResult());
                _base.Record.CopyValues(obj);

                _base.ProviderBase.Productos = ProductoProveedores.GetChildList(this, false);
                _base.ProviderBase.Productos.Clear();
                _base.ProviderBase.Productos.Update(this);

                Session().Delete(obj);
                Transaction().Commit();
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
            finally
            {
                CloseSession();
            }
        }
예제 #2
0
 protected override void DataPortal_Update()
 {
     if (IsDirty)
     {
         try
         {
             moleQule.Store.Data.ShippingCompanyRecord obj = Session().Get <moleQule.Store.Data.ShippingCompanyRecord>(Oid);
             obj.CopyValues(Base.Record);
             Session().Update(obj);
         }
         catch (Exception ex)
         {
             iQExceptionHandler.TreatException(ex);
         }
     }
 }