Exemplo n.º 1
0
        /// <summary>
        /// Envia los cambios del tsh_ContactosRow a la base de datos realizando una validacin previa.
        /// </summary>
        public static void UpdateWithValidation(tsh_ContactosDataset.tsh_ContactosRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
Exemplo n.º 2
0
        public static void Update(tsh_ContactosDataset.tsh_ContactosRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tsh_ContactosDataset.tsh_ContactosDataTable)row.Table).Addtsh_ContactosRow(row);
            }

            Update(row.Table);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Obtiene un registro de la tabla tsh_Contactos que luego puede ser persistido en la base de datos.
 /// </summary>
 public static tsh_ContactosDataset.tsh_ContactosRow GetByPk(string IdCuenta, string IdPersona)
 {
     tsh_ContactosDataset.tsh_ContactosRow row = mz.erp.dataaccess.tsh_Contactos.GetByPk(IdCuenta, IdPersona);
     foreach (DataColumn dc in row.Table.Columns)
     {
         if (!dc.Caption.ToUpper().Equals("ROWID") && !dc.Caption.ToUpper().Equals("ULTIMAMODIFICACION"))
         {
             if (row[dc] == System.DBNull.Value)
             {
                 row[dc] = Util.DefaultValue(dc.DataType);
             }
         }
     }
     return(row);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Establece los valores por defecto de tsh_ContactosRow.
        /// </summary>
        public static tsh_ContactosDataset.tsh_ContactosRow SetRowDefaultValues(tsh_ContactosDataset.tsh_ContactosRow row)
        {
            row.IdCuenta                     = Util.NewStringId();
            row.IdPersona                    = Util.NewStringId();
            row.IdTipoContacto               = 0;
            row.IdCargo                      = 0;
            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;

            return(row);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Valida un tsh_ContactosRow.
        /// </summary>
        public static bool RowIsValid(tsh_ContactosDataset.tsh_ContactosRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);


            if (!IdCuentaIsValid(row.IdCuenta))
            {
                return(false);
            }

            if (!IdPersonaIsValid(row.IdPersona))
            {
                return(false);
            }

            if (!IdTipoContactoIsValid(row.IdTipoContacto))
            {
                return(false);
            }

            if (!IdCargoIsValid(row.IdCargo))
            {
                return(false);
            }

            if (!FechaCreacionIsValid(row.FechaCreacion))
            {
                return(false);
            }

            if (!IdConexionCreacionIsValid(row.IdConexionCreacion))
            {
                return(false);
            }

            if (!UltimaModificacionIsValid(row.UltimaModificacion))
            {
                return(false);
            }

            if (!IdConexionUltimaModificacionIsValid(row.IdConexionUltimaModificacion))
            {
                return(false);
            }

            if (!IdReservadoIsValid(row.IdReservado))
            {
                return(false);
            }

            if (!RowIdIsValid(row.RowId))
            {
                return(false);
            }

            if (!IdEmpresaIsValid(row.IdEmpresa))
            {
                return(false);
            }
            ;

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

            mz.erp.dataaccess.tsh_Contactos.Update(row);
        }