Ejemplo n.º 1
0
        public static void UpdateWithValidation(tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
Ejemplo n.º 2
0
        public static void Update(tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioDataTable)row.Table).Addtfi_FuentesDeCambioRow(row);
            }

            Update(row.Table);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Obtiene un registro de la tabla tfi_FuentesDeCambio que luego puede ser persistido en la base de datos.
 /// </summary>
 public static tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow GetByPk(string IdFuenteDeCamibo)
 {
     tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow row = mz.erp.dataaccess.tfi_FuentesDeCambio.GetByPk(IdFuenteDeCamibo);
     foreach (DataColumn dc in row.Table.Columns)
     {
         if (!dc.Caption.ToUpper().Equals("ROWID"))
         {
             if (row[dc] == System.DBNull.Value)
             {
                 row[dc] = Util.DefaultValue(dc.DataType);
             }
         }
     }
     return(row);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Valida un tfi_FuentesDeCambioRow.
        /// </summary>
        public static bool RowIsValid(tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);
            bool   isValid = true;
            string mensaje;


            if (!IdFuenteDeCamiboIsValid(row.IdFuenteDeCambio, out mensaje))
            {
                row.SetColumnError("IdFuenteDeCamibo", mensaje);
                isValid = false;
            }

            if (!DescripcionIsValid(row.Descripcion, out mensaje))
            {
                row.SetColumnError("Descripcion", mensaje);
                isValid = false;
            }

            if (!FechaCreacionIsValid(row.FechaCreacion, out mensaje))
            {
                row.SetColumnError("FechaCreacion", mensaje);
                isValid = false;
            }

            if (!IdConexionCreacionIsValid(row.IdConexionCreacion, out mensaje))
            {
                row.SetColumnError("IdConexionCreacion", mensaje);
                isValid = false;
            }

            if (!UltimaModificacionIsValid(row.UltimaModificacion, out mensaje))
            {
                row.SetColumnError("UltimaModificacion", mensaje);
                isValid = false;
            }

            if (!IdConexionUltimaModificacionIsValid(row.IdConexionUltimaModificacion, out mensaje))
            {
                row.SetColumnError("IdConexionUltimaModificacion", mensaje);
                isValid = false;
            }

            if (!IdReservadoIsValid(row.IdReservado, out mensaje))
            {
                row.SetColumnError("IdReservado", mensaje);
                isValid = false;
            }

            if (!RowIdIsValid(row.RowId, out mensaje))
            {
                row.SetColumnError("RowId", mensaje);
                isValid = false;
            }

            if (!IdEmpresaIsValid(row.IdEmpresa, out mensaje))
            {
                row.SetColumnError("IdEmpresa", mensaje);
                isValid = false;
            }

            if (!IdSucursalIsValid(row.IdSucursal, out mensaje))
            {
                row.SetColumnError("IdSucursal", mensaje);
                isValid = false;
            }
            ;

            return(isValid);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Envia los cambios del tfi_FuentesDeCambioRow a la base de datos.
        /// </summary>
        public static void Update(tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tfi_FuentesDeCambio.Update(row);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Establece los valores por defecto de tfi_FuentesDeCambioRow.
        /// </summary>
        public static tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow SetRowDefaultValues(tfi_FuentesDeCambioDataset.tfi_FuentesDeCambioRow row)
        {
            row.IdFuenteDeCambio             = Util.NewStringId();
            row.Descripcion                  = string.Empty;
            row.FechaCreacion                = mz.erp.businessrules.Sistema.DateTime.Now;
            row.IdConexionCreacion           = Security.IdConexion;
            row.UltimaModificacion           = null;
            row.IdConexionUltimaModificacion = Security.IdConexion;
            row.IdReservado                  = 0;
            row.RowId      = Guid.Empty;
            row.IdEmpresa  = Security.IdEmpresa;
            row.IdSucursal = Security.IdSucursal;

            return(row);
        }