コード例 #1
0
ファイル: sy_Reglas.cs プロジェクト: windygu/ger20160318
        /// <summary>
        /// Valida un sy_ReglasRow.
        /// </summary>
        public static bool RowIsValid(sy_ReglasDataset.sy_ReglasRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);
            bool   isValid = true;
            string mensaje;


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

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

            if (!ComentarioIsValid(row.Comentario, out mensaje))
            {
                row.SetColumnError("Comentario", 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 (!RowIdIsValid(row.RowId, out mensaje))
            {
                row.SetColumnError("RowId", mensaje);
                isValid = false;
            }
            ;

            return(isValid);
        }
コード例 #2
0
ファイル: sy_Reglas.cs プロジェクト: windygu/ger20160318
        public static void UpdateWithValidation(sy_ReglasDataset.sy_ReglasRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
コード例 #3
0
ファイル: sy_Reglas.cs プロジェクト: windygu/ger20160318
        public static void Update(sy_ReglasDataset.sy_ReglasRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((sy_ReglasDataset.sy_ReglasDataTable)row.Table).Addsy_ReglasRow(row);
            }

            Update(row.Table);
        }
コード例 #4
0
ファイル: sy_Reglas.cs プロジェクト: windygu/ger20160318
        /// <summary>
        /// Establece los valores por defecto de sy_ReglasRow.
        /// </summary>
        public static sy_ReglasDataset.sy_ReglasRow SetRowDefaultValues(sy_ReglasDataset.sy_ReglasRow row)
        {
            row.IdRegla                      = Util.NewStringId();
            row.Descripcion                  = string.Empty;
            row.Comentario                   = string.Empty;
            row.FechaCreacion                = DateTime.Now;
            row.IdConexionCreacion           = Security.IdConexion;
            row.UltimaModificacion           = null;
            row.IdConexionUltimaModificacion = Security.IdConexion;
            row.RowId = Guid.Empty;

            return(row);
        }
コード例 #5
0
        public Regla GetRegla(string IdRegla)
        {
            sy_ReglasDataset.sy_ReglasRow rowR = sy_Reglas.GetByPk(IdRegla);
            Regla regla = new Regla(rowR);

            sy_ConfiguracionesReglasDataset.sy_ConfiguracionesReglasDataTable tableConf = sy_ConfiguracionesReglas.GetList(IdRegla).sy_ConfiguracionesReglas;
            Hashtable configuraciones = new Hashtable();

            foreach (sy_ConfiguracionesReglasDataset.sy_ConfiguracionesReglasRow rowC in tableConf.Rows)
            {
                ConfiguracionRegla conf = new ConfiguracionRegla(rowC);
                configuraciones.Add(conf.IdConfiguracion, conf);
            }
            regla.Configuraciones = configuraciones;
            return(regla);
        }
コード例 #6
0
ファイル: sy_Reglas.cs プロジェクト: windygu/ger20160318
 /// <summary>
 /// Obtiene un registro de la tabla sy_Reglas que luego puede ser persistido en la base de datos.
 /// </summary>
 public static sy_ReglasDataset.sy_ReglasRow GetByPk(string IdRegla)
 {
     sy_ReglasDataset.sy_ReglasRow row = mz.erp.dataaccess.sy_Reglas.GetByPk(IdRegla);
     if (row != null)
     {
         foreach (DataColumn dc in row.Table.Columns)
         {
             if (row[dc] == System.DBNull.Value)
             {
                 if (dc.Caption != "RowId")
                 {
                     row[dc] = Util.DefaultValue(dc.DataType);
                 }
             }
         }
     }
     return(row);
 }
コード例 #7
0
ファイル: sy_Reglas.cs プロジェクト: windygu/ger20160318
        /// <summary>
        /// Envia los cambios del sy_ReglasRow a la base de datos.
        /// </summary>
        public static void Update(sy_ReglasDataset.sy_ReglasRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.sy_Reglas.Update(row);
        }
コード例 #8
0
 private Regla(sy_ReglasDataset.sy_ReglasRow row)
 {
     _idRegla    = row.IdRegla;
     _decripcion = row.Descripcion;
     _comentario = row.Comentario;
 }