49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using System;
|
|
using System.Data;
|
|
|
|
namespace Net.Connection.Attributes
|
|
{
|
|
public class DBParameter : Attribute
|
|
{
|
|
public string name { get; set; }
|
|
public int size { get; set; }
|
|
public SqlDbType dbType { get; set; }
|
|
public ParameterDirection direction { get; set; }
|
|
public ActionType actionType;
|
|
|
|
public Boolean Key { get; set; }
|
|
|
|
/// <summary>
|
|
/// Asignacion del Tipo de Dato
|
|
/// </summary>
|
|
/// <param name="dbType">Tipo de dato</param>
|
|
/// <param name="actionType">Accion a realizar Everything, View, Insert, Update, Delete</param>
|
|
/// <param name="Key">Primary Key</param>
|
|
public DBParameter(SqlDbType dbType, ActionType actionType, Boolean Key)
|
|
{
|
|
DBParameterMethod(dbType, 0, ParameterDirection.Input, "", actionType, Key);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Asignacion del Tipo de Dato
|
|
/// </summary>
|
|
/// <param name="dbType">Tipo de Dato</param>
|
|
/// <param name="size">Tamano</param>
|
|
/// <param name="actionType">Accion a realizar Everything, View, Insert, Update, Delete</param>
|
|
public DBParameter(SqlDbType dbType, int size, ActionType actionType)
|
|
{
|
|
DBParameterMethod(dbType, size, ParameterDirection.Input, "", actionType, false);
|
|
}
|
|
|
|
private void DBParameterMethod(SqlDbType dbType, int size, ParameterDirection direction, string name, ActionType actionType, Boolean Key)
|
|
{
|
|
this.dbType = dbType;
|
|
this.direction = direction;
|
|
this.size = size;
|
|
this.name = name;
|
|
this.actionType = actionType;
|
|
this.Key = Key;
|
|
}
|
|
}
|
|
}
|