コード例 #1
0
        /// <summary>
        /// Verifica si existe marcas. Si exite alguna marca retorna el registro.
        /// </summary>
        /// <param name="pIBlockingMark">Marca</param>
        /// <param name="pBlockingTable">Nombre de la tabla de Blocking</param>
        /// <returns>Registro blocking</returns>
        internal static bool Exists(IBlockingMark pIBlockingMark, String pBlockingTable)
        {
            SqlParameter wParam;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
                using (SqlCommand wCmd = new SqlCommand(pBlockingTable + "_g_Exist", wCnn))
                {
                    Boolean wExist;

                    wCmd.CommandType = CommandType.StoredProcedure;

                    wParam           = wCmd.Parameters.Add("@Exist", SqlDbType.Bit);
                    wParam.Direction = ParameterDirection.Output;

                    if (pIBlockingMark.FwkGuid != null)
                    {
                        wParam       = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                        wParam.Value = pIBlockingMark.FwkGuid;
                    }

                    //BlockingId
                    if (pIBlockingMark.BlockingId != null)
                    {
                        wParam       = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                        wParam.Value = pIBlockingMark.BlockingId;
                    }

                    wCnn.Open();
                    wCmd.ExecuteNonQuery();
                    wExist = Boolean.Parse(wCmd.Parameters["@Exist"].Value.ToString());

                    return(wExist);
                }
        }
コード例 #2
0
        protected override List <SqlParameter> GetCustomParametersToInsert(IBlockingMark pIBlockingMark)
        {
            BlockingMarkArchivosGraficos wBlockingMarkClass = (BlockingMarkArchivosGraficos)pIBlockingMark;

            List <SqlParameter> wSqlParameterCollection = new List <SqlParameter>();

            /// Crea los parámetros del Stored Procedure
            SqlParameter wParam = new SqlParameter();

            //CodigoNota
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoNota";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.CodigoNota;

            //CodigoPagina
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoPagina";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.CodigoPagina;

            //IdArchivo
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@IdArchivo";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.IdArchivo;



            return(wSqlParameterCollection);
        }
コード例 #3
0
ファイル: BlockingEngineBase.cs プロジェクト: gpanayir/sffwk
 /// <summary>
 /// Realiza un bloqueo creando una
 /// BlockingMarks. Previamente verifica que no haya sido bloqueadas
 /// anteriormente ninguna de las instancias.
 /// </summary>
 /// <param name="IBlockingMark"><see cref="IBlockingMark"/></param>
 public int Create(IBlockingMark pIBlockingMark)
 {
     ///Llama a al metodo abstracto que es implementado por las clases hijas para obtener los
     ///parametros customizados.-
     List<SqlParameter> wSqlParameterlist = GetCustomParametersToInsert(pIBlockingMark);
     
     return BlockingEngineDAC.AddMark(pIBlockingMark, wSqlParameterlist,_Table_BlockingMarks_Name);
 }
コード例 #4
0
        /// <summary>
        /// Realiza un bloqueo creando una
        /// BlockingMarks. Previamente verifica que no haya sido bloqueadas
        /// anteriormente ninguna de las instancias.
        /// </summary>
        /// <param name="pIBlockingMark"><see cref="IBlockingMark"/></param>
        public int Create(IBlockingMark pIBlockingMark)
        {
            ///Llama a al metodo abstracto que es implementado por las clases hijas para obtener los
            ///parametros customizados.-
            List <SqlParameter> wSqlParameterlist = GetCustomParametersToInsert(pIBlockingMark);

            return(BlockingEngineDAC.AddMark(pIBlockingMark, wSqlParameterlist, _Table_BlockingMarks_Name));
        }
コード例 #5
0
        protected override List<SqlParameter> GetCustomParametersToInsert(IBlockingMark pIBlockingMark)
        {
            BlockingMarkAudioVisual wBlockingMarkClass = (BlockingMarkAudioVisual)pIBlockingMark;

            List<SqlParameter> wSqlParameterCollection = new List<SqlParameter>();

            /// Crea los parámetros del Stored Procedure
            SqlParameter wParam = new SqlParameter();
            //CodigoBloque
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoBloque";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.CodigoBloque;

            //CodigoMedio
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoMedio";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.CodigoMedio;

            //FechaHoraInicioTransmision
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@FechaHoraInicioTransmision";
            wParam.SqlDbType = SqlDbType.DateTime;
            wParam.Value = wBlockingMarkClass.FechaHoraInicioTransmision;

            //FechaHoraFinTransmision
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@FechaHoraFinTransmision";
            wParam.SqlDbType = SqlDbType.DateTime;
            wParam.Value = wBlockingMarkClass.FechaHoraFinTransmision;

            //Objeto
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@Objeto";
            wParam.SqlDbType = SqlDbType.Bit;
            wParam.Value = wBlockingMarkClass.Objeto;

            //EsOnline
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@EsOnline";
            wParam.SqlDbType = SqlDbType.Bit;
            wParam.Value = wBlockingMarkClass.EsOnline;


            return wSqlParameterCollection;




         
        }
コード例 #6
0
        /// <summary>
        /// Agrega una marca de bloqueo para una instancia de
        /// BlockingMark.
        /// </summary>
        /// <param name="pIBlockingMark">pIBlockingMark que contiene a la BlockingMark.
        /// Se incluye debido a que la tabla BlockingMarks está desnormalizada y
        /// requiere algunos campos de esta Clase.</param>
        /// <param name="pBlockingMark">BlockingMark a crear.</param>
        /// <param name="pCustomParametersToInsert">BlockingMark a crear.</param>
        /// <param name="pBlockingTable">BlockingMark a crear.</param>
        internal static int AddMark(IBlockingMark pIBlockingMark, List <SqlParameter> pCustomParametersToInsert, String pBlockingTable)
        {
            SqlParameter wParam;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
                using (SqlCommand wCmd = new SqlCommand(pBlockingTable + "_i", wCnn))
                {
                    wCmd.CommandType = CommandType.StoredProcedure;

                    if (pCustomParametersToInsert != null)
                    {
                        if (pCustomParametersToInsert.Count != 0)
                        {
                            wCmd.Parameters.AddRange(pCustomParametersToInsert.ToArray());
                        }
                    }


                    wParam           = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                    wParam.Direction = ParameterDirection.Output;

                    //TableName
                    wParam       = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.TableName;

                    //Attribute
                    wParam       = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.Attribute;
                    //AttValue
                    wParam       = wCmd.Parameters.Add("@AttValue", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.AttValue;

                    wParam       = wCmd.Parameters.Add("@TTL", SqlDbType.Int);
                    wParam.Value = pIBlockingMark.TTL;

                    wParam       = wCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.User;

                    wParam       = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                    wParam.Value = pIBlockingMark.FwkGuid;

                    wParam = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 100);
                    if (String.IsNullOrEmpty(pIBlockingMark.Process))
                    {
                        wParam.Value = null;
                    }
                    else
                    {
                        wParam.Value = pIBlockingMark.Process;
                    }

                    wCnn.Open();
                    wCmd.ExecuteNonQuery();

                    return(int.Parse(wCmd.Parameters["@BlockingId"].Value.ToString()));
                }
        }
コード例 #7
0
        /// <summary>
        /// Obtiene una o valraias marcas de bloqueo
        /// </summary>
        /// <param name="pIBlockingMark">Clase que implementa IBlockingMark</param>
        /// <param name="pCustomParametersGetByParam">Parametros para una IBlockingMark personalizada</param>
        /// <returns>Tabla con laas marcas obtenidas.-</returns>
        internal static DataTable GetByParam(IBlockingMark pIBlockingMark, List <SqlParameter> pCustomParametersGetByParam)
        {
            DataSet      wDS = new DataSet();
            SqlParameter wParam;
            string       wUsuario = string.Empty;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
                using (SqlCommand wCmd = new SqlCommand(pIBlockingMark.TableName + "_s", wCnn))
                {
                    wCmd.CommandType = CommandType.StoredProcedure;
                    if (pCustomParametersGetByParam != null)
                    {
                        if (pCustomParametersGetByParam.Count != 0)
                        {
                            wCmd.Parameters.AddRange(pCustomParametersGetByParam.ToArray());
                        }
                    }

                    //BlockingId
                    wParam       = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int, 4);
                    wParam.Value = pIBlockingMark.BlockingId;

                    //TableName
                    wParam       = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.TableName;

                    //Attribute
                    wParam       = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.Attribute;

                    //TTL
                    wParam       = wCmd.Parameters.Add("@TTL", SqlDbType.Int, 4);
                    wParam.Value = pIBlockingMark.TTL;

                    //UserName
                    wParam       = wCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 32);
                    wParam.Value = pIBlockingMark.User;

                    //FwkGuid
                    wParam       = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                    wParam.Value = pIBlockingMark.FwkGuid;

                    //DueDate
                    wParam       = wCmd.Parameters.Add("@DueDate", SqlDbType.DateTime);
                    wParam.Value = pIBlockingMark.DueDate;

                    //Process
                    wParam       = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 50);
                    wParam.Value = pIBlockingMark.Process;

                    SqlDataAdapter wDA = new SqlDataAdapter(wCmd);

                    wDA.Fill(wDS);
                    return(wDS.Tables[0]);
                }
        }
コード例 #8
0
        protected override List <SqlParameter> GetCustomParametersToInsert(IBlockingMark pIBlockingMark)
        {
            BlockingMarkAudioVisual wBlockingMarkClass = (BlockingMarkAudioVisual)pIBlockingMark;

            List <SqlParameter> wSqlParameterCollection = new List <SqlParameter>();

            /// Crea los parámetros del Stored Procedure
            SqlParameter wParam = new SqlParameter();

            //CodigoBloque
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoBloque";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.CodigoBloque;

            //CodigoMedio
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoMedio";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.CodigoMedio;

            //FechaHoraInicioTransmision
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@FechaHoraInicioTransmision";
            wParam.SqlDbType     = SqlDbType.DateTime;
            wParam.Value         = wBlockingMarkClass.FechaHoraInicioTransmision;

            //FechaHoraFinTransmision
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@FechaHoraFinTransmision";
            wParam.SqlDbType     = SqlDbType.DateTime;
            wParam.Value         = wBlockingMarkClass.FechaHoraFinTransmision;

            //Objeto
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@Objeto";
            wParam.SqlDbType     = SqlDbType.Bit;
            wParam.Value         = wBlockingMarkClass.Objeto;

            //EsOnline
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@EsOnline";
            wParam.SqlDbType     = SqlDbType.Bit;
            wParam.Value         = wBlockingMarkClass.EsOnline;


            return(wSqlParameterCollection);
        }
コード例 #9
0
ファイル: BlockingEngineDAC.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>
        /// Agrega una marca de bloqueo para una instancia de
        /// BlockingMark.
        /// </summary>
        /// <param name="pIBlockingMark">pIBlockingMark que contiene a la BlockingMark.
        /// Se incluye debido a que la tabla BlockingMarks está desnormalizada y
        /// requiere algunos campos de esta Clase.</param>
        /// <param name="pBlockingMark">BlockingMark a crear.</param>
        /// <param name="pCustomParametersToInsert">BlockingMark a crear.</param>
        /// <param name="pBlockingTable">BlockingMark a crear.</param>
        internal static int AddMark(IBlockingMark pIBlockingMark, List<SqlParameter> pCustomParametersToInsert, String pBlockingTable)
        {
            SqlParameter wParam;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
            using (SqlCommand wCmd = new SqlCommand(pBlockingTable + "_i", wCnn))
            {
                wCmd.CommandType = CommandType.StoredProcedure;

                if (pCustomParametersToInsert != null)
                    if (pCustomParametersToInsert.Count != 0)
                        wCmd.Parameters.AddRange(pCustomParametersToInsert.ToArray());


                wParam = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                wParam.Direction = ParameterDirection.Output;

                //TableName
                wParam = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 100);
                wParam.Value = pIBlockingMark.TableName;

                //Attribute
                wParam = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 100);
                wParam.Value = pIBlockingMark.Attribute;
                //AttValue
                wParam = wCmd.Parameters.Add("@AttValue", SqlDbType.VarChar, 100);
                wParam.Value = pIBlockingMark.AttValue;

                wParam = wCmd.Parameters.Add("@TTL", SqlDbType.Int);
                wParam.Value = pIBlockingMark.TTL;

                wParam = wCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 100);
                wParam.Value = pIBlockingMark.User;

                wParam = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                wParam.Value = pIBlockingMark.FwkGuid;

                wParam = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 100);
                if (String.IsNullOrEmpty(pIBlockingMark.Process))
                    wParam.Value = null;
                else
                    wParam.Value = pIBlockingMark.Process;

                wCnn.Open();
                wCmd.ExecuteNonQuery();

                return int.Parse(wCmd.Parameters["@BlockingId"].Value.ToString());

            }
        }
コード例 #10
0
        protected override List <SqlParameter> GetCustomParametersUserExist(IBlockingMark pIBlockingMark)
        {
            BlockingMarkArchivosGraficos wBlockingMarkClass = (BlockingMarkArchivosGraficos)pIBlockingMark;

            List <SqlParameter> wSqlParameterCollection = new List <SqlParameter>();

            /// Crea los parámetros del Stored Procedure
            SqlParameter wParam = new SqlParameter();

            //CodigoNota
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigosNotas";
            wParam.SqlDbType     = SqlDbType.VarChar;
            if (string.IsNullOrEmpty(wBlockingMarkClass.ListaCodigoNotas))
            {
                wParam.Value = null;
            }
            else
            {
                wParam.Value = wBlockingMarkClass.ListaCodigoNotas;
            }

            //CodigoNota
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoNota";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.CodigoNota;

            //CodigoPagina
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoPagina";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.CodigoPagina;

            //IdArchivo

            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@IdArchivo";
            wParam.SqlDbType     = SqlDbType.Int;
            wParam.Value         = wBlockingMarkClass.IdArchivo;

            return(wSqlParameterCollection);
        }
コード例 #11
0
        protected override List<SqlParameter> GetCustomParametersUserExist(IBlockingMark pIBlockingMark)
        {
            BlockingMarkArchivosGraficos wBlockingMarkClass = (BlockingMarkArchivosGraficos)pIBlockingMark;

            List<SqlParameter> wSqlParameterCollection = new List<SqlParameter>();

            /// Crea los parámetros del Stored Procedure
            SqlParameter wParam = new SqlParameter();

            //CodigoNota
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigosNotas";
            wParam.SqlDbType = SqlDbType.VarChar;
            if (string.IsNullOrEmpty(wBlockingMarkClass.ListaCodigoNotas))
                wParam.Value = null;
            else
                wParam.Value = wBlockingMarkClass.ListaCodigoNotas;

            //CodigoNota
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoNota";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.CodigoNota;

            //CodigoPagina
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoPagina";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.CodigoPagina;

            //IdArchivo

            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@IdArchivo";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.IdArchivo;

            return wSqlParameterCollection;
        }
コード例 #12
0
        /// <summary>
        /// Eliminar marca de blocking.-
        /// </summary>
        internal static void RemoveMark(IBlockingMark pBlockingMark)
        {
            /// Una vez que el Contexto pasó los controles, se procede a la liberación.
            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
                using (SqlCommand wCmd = new SqlCommand(pBlockingMark.TableName + "_d", wCnn))
                {
                    wCmd.CommandType = CommandType.StoredProcedure;
                    SqlParameter wParam;

                    wParam       = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                    wParam.Value = pBlockingMark.BlockingId;


                    wParam       = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                    wParam.Value = pBlockingMark.FwkGuid;

                    wCnn.Open();

                    wCmd.ExecuteNonQuery();
                }
        }
コード例 #13
0
        protected override List<SqlParameter> GetCustomParametersToInsert(IBlockingMark pIBlockingMark)
        {
            BlockingMarkArchivosGraficos wBlockingMarkClass = (BlockingMarkArchivosGraficos)pIBlockingMark;

            List<SqlParameter> wSqlParameterCollection = new List<SqlParameter>();

            /// Crea los parámetros del Stored Procedure
            SqlParameter wParam = new SqlParameter();

            //CodigoNota
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoNota";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.CodigoNota;

            //CodigoPagina
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@CodigoPagina";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.CodigoPagina;

            //IdArchivo
            wParam = new SqlParameter();
            wSqlParameterCollection.Add(wParam);
            wParam.ParameterName = "@IdArchivo";
            wParam.SqlDbType = SqlDbType.Int;
            wParam.Value = wBlockingMarkClass.IdArchivo;

            


            return wSqlParameterCollection;




         
        }
コード例 #14
0
 protected override List <SqlParameter> GetCustomParametersUserExist(IBlockingMark pBlockingMark)
 {
     throw new Exception("The method or operation is not implemented.");
 }
コード例 #15
0
        /// <summary>Obtiene una o varias marcas de bloqueo</summary>
        /// <param name="pIBlockingMark">Clase que implementa IBlockingMark</param>
        /// <returns>Tabla con las marcas obtenidas
        /// Datatable con BlockingId,TableName,Attribute,AttValue,TTL,UserName,FwkGuid,DueDate,Process</returns>
        /// <create>hebraida</create>
        /// <date>2010-07-15</date>
        internal static DataTable GetByParam(IBlockingMark pIBlockingMark)
        {
            DataSet      wDS = new DataSet();
            SqlParameter wParam;
            string       wUsuario = string.Empty;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
                using (SqlCommand wCmd = new SqlCommand("BlockingMarks_s", wCnn))
                {
                    wCmd.CommandType = CommandType.StoredProcedure;

                    //BlockingId
                    if (pIBlockingMark.BlockingId != 0)
                    {
                        wParam       = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int, 4);
                        wParam.Value = pIBlockingMark.BlockingId;
                    }

                    //TableName
                    if (!string.IsNullOrEmpty(pIBlockingMark.TableName))
                    {
                        wParam       = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 100);
                        wParam.Value = pIBlockingMark.TableName;
                    }

                    //Attribute
                    if (!string.IsNullOrEmpty(pIBlockingMark.Attribute))
                    {
                        wParam       = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 100);
                        wParam.Value = pIBlockingMark.Attribute;
                    }

                    //AttValue
                    if (!string.IsNullOrEmpty(pIBlockingMark.AttValue))
                    {
                        wParam       = wCmd.Parameters.Add("@AttValue", SqlDbType.VarChar, 100);
                        wParam.Value = pIBlockingMark.AttValue;
                    }



                    //UserName
                    if (!string.IsNullOrEmpty(pIBlockingMark.User))
                    {
                        wParam       = wCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 32);
                        wParam.Value = pIBlockingMark.User;
                    }

                    //FwkGuid
                    if (pIBlockingMark.FwkGuid.HasValue)
                    {
                        wParam       = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                        wParam.Value = pIBlockingMark.FwkGuid;
                    }

                    //DueDate
                    if (pIBlockingMark.DueDate.HasValue)
                    {
                        wParam       = wCmd.Parameters.Add("@DueDate", SqlDbType.DateTime);
                        wParam.Value = pIBlockingMark.DueDate;
                    }

                    //Process
                    if (!string.IsNullOrEmpty(pIBlockingMark.Process))
                    {
                        wParam       = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 50);
                        wParam.Value = pIBlockingMark.Process;
                    }

                    SqlDataAdapter wDA = new SqlDataAdapter(wCmd);

                    wDA.Fill(wDS);
                    return(wDS.Tables[0]);
                }
        }
コード例 #16
0
ファイル: BlockingEngineBase.cs プロジェクト: gpanayir/sffwk
    /// <summary>
    /// Verifica si existe marcas. Si exite alguna marca retorna los usuarios.
    /// </summary>
    /// <param name="pBlockingMark"></param>
    /// <returns></returns>
    public List<string> ExistsUser(IBlockingMark pBlockingMark)
    {
        List<SqlParameter> wSqlParameterlist = GetCustomParametersUserExist(pBlockingMark);
 
        return BlockingEngineDAC.ExistsUsers(pBlockingMark, wSqlParameterlist,_Table_BlockingMarks_Name);
    }
コード例 #17
0
ファイル: BlockingEngineBase.cs プロジェクト: gpanayir/sffwk
 protected abstract List<SqlParameter> GetCustomParametersUserExist(IBlockingMark pBlockingMark);
コード例 #18
0
 protected override List<SqlParameter> GetCustomParametersUserExist(IBlockingMark pBlockingMark)
 {
     throw new Exception("The method or operation is not implemented.");
 }
コード例 #19
0
ファイル: BlockingEngineDAC.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>Obtiene una o varias marcas de bloqueo</summary>
        /// <param name="pIBlockingMark">Clase que implementa IBlockingMark</param>
        /// <returns>Tabla con las marcas obtenidas</returns>
        /// <create>hebraida</create>
        /// <date>2010-07-15</date>
        internal static DataTable GetByParam(IBlockingMark pIBlockingMark)
        {
            DataSet wDS = new DataSet();
            SqlParameter wParam;
            string wUsuario = string.Empty;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
            using (SqlCommand wCmd = new SqlCommand("BlockingMarks_s", wCnn))
            {

                wCmd.CommandType = CommandType.StoredProcedure;

                //BlockingId
                if (pIBlockingMark.BlockingId != 0)
                {
                    wParam = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int, 4);
                    wParam.Value = pIBlockingMark.BlockingId;
                }

                //TableName
                if (!string.IsNullOrEmpty(pIBlockingMark.TableName))
                {
                    wParam = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.TableName;
                }

                //Attribute
                if (!string.IsNullOrEmpty(pIBlockingMark.Attribute))
                {
                    wParam = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.Attribute;
                }

                //AttValue
                if (!string.IsNullOrEmpty(pIBlockingMark.AttValue))
                {
                    wParam = wCmd.Parameters.Add("@AttValue", SqlDbType.VarChar, 100);
                    wParam.Value = pIBlockingMark.AttValue;
                }

                //TTL
                if (pIBlockingMark.TTL != 0)
                {
                    wParam = wCmd.Parameters.Add("@TTL", SqlDbType.Int, 4);
                    wParam.Value = pIBlockingMark.TTL;
                }

                //UserName
                if (!string.IsNullOrEmpty(pIBlockingMark.User))
                {
                    wParam = wCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 32);
                    wParam.Value = pIBlockingMark.User;
                }

                //FwkGuid
                if (pIBlockingMark.FwkGuid.HasValue)
                {
                    wParam = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                    wParam.Value = pIBlockingMark.FwkGuid;
                }

                //DueDate
                if (pIBlockingMark.DueDate.HasValue)
                {
                    wParam = wCmd.Parameters.Add("@DueDate", SqlDbType.DateTime);
                    wParam.Value = pIBlockingMark.DueDate;
                }

                //Process
                if (!string.IsNullOrEmpty(pIBlockingMark.Process))
                {
                    wParam = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 50);
                    wParam.Value = pIBlockingMark.Process;
                }

                SqlDataAdapter wDA = new SqlDataAdapter(wCmd);

                wDA.Fill(wDS);
                return wDS.Tables[0];

            }
        }
コード例 #20
0
ファイル: BlockingEngineDAC.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>
        /// Verifica si existe marcas. Si exite alguna marca retorna los usuarios.
        /// </summary>
        /// <param name="pIBlockingMark">Marca</param>
        /// <param name="pCustomParametersExist">Parametros personalizados</param>
        /// <param name="pBlockingTable">Parametros personalizados</param>
        /// <returns></returns>
        internal static List<String> ExistsUsers(IBlockingMark pIBlockingMark, List<SqlParameter> pCustomParametersExist, String pBlockingTable)
        {
            List<string> strUserList = new List<string>();
            SqlParameter wParam;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
            using (SqlCommand wCmd = new SqlCommand(pBlockingTable + "_g_ExistUser", wCnn))
            {

                wCmd.CommandType = CommandType.StoredProcedure;
                if (pCustomParametersExist != null)
                    if (pCustomParametersExist.Count != 0)
                        wCmd.Parameters.AddRange(pCustomParametersExist.ToArray());

                if (pIBlockingMark.FwkGuid != null)
                {
                    wParam = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                    wParam.Value = pIBlockingMark.FwkGuid;
                }

                //BlockingId
                if (pIBlockingMark.BlockingId != null)
                {
                    wParam = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                    wParam.Value = pIBlockingMark.BlockingId;
                }

                //Attribute
                if (pIBlockingMark.Attribute != null)
                {
                    wParam = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 50);
                    wParam.Value = pIBlockingMark.Attribute;
                }
                //AttValue
                if (pIBlockingMark.AttValue != null)
                {
                    wParam = wCmd.Parameters.Add("@AttValue", SqlDbType.VarChar, 50);
                    wParam.Value = pIBlockingMark.AttValue;
                }

                //Process
                if (pIBlockingMark.Process != null)
                {
                    wParam = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 50);
                    wParam.Value = pIBlockingMark.Process;
                }

                //TableName
                if (pIBlockingMark.TableName != null)
                {
                    wParam = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 50);
                    wParam.Value = pIBlockingMark.TableName;
                }

                wCnn.Open();

                IDataReader reader = wCmd.ExecuteReader();
                while (reader.Read())
                {
                    strUserList.Add(reader["UserName"].ToString());
                }
               return strUserList;
            }
        }
コード例 #21
0
 GetCustomParametersToInsert(IBlockingMark pBlockingMark)
 {
     return(null);
 }
コード例 #22
0
 GetCustomParametersToGetByParams(IBlockingMark pBlockingMark)
 {
     return(null);
 }
コード例 #23
0
ファイル: FwkBlockingEngine.cs プロジェクト: gpanayir/sffwk
     GetCustomParametersToGetByParams(IBlockingMark pBlockingMark)
 {
     return null;
 }
コード例 #24
0
ファイル: BlockingEngineDAC.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>
        /// Eliminar marca de blocking.-
        /// </summary>
        internal static void RemoveMark(IBlockingMark pBlockingMark)
        {
            /// Una vez que el Contexto pasó los controles, se procede a la liberación.
            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
            using (SqlCommand wCmd = new SqlCommand(pBlockingMark.TableName + "_d", wCnn))
            {

                wCmd.CommandType = CommandType.StoredProcedure;
                SqlParameter wParam;

                wParam = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                wParam.Value = pBlockingMark.BlockingId;


                wParam = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                wParam.Value = pBlockingMark.FwkGuid;

                wCnn.Open();

                wCmd.ExecuteNonQuery();

            }
        }
コード例 #25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pBlockingMark"></param>
        /// <returns></returns>
        public DataTable GetByParamCustom(IBlockingMark pBlockingMark)
        {
            List <SqlParameter> wSqlParameterlist = GetCustomParametersToGetByParams(pBlockingMark);

            return(BlockingEngineDAC.GetByParam(pBlockingMark, wSqlParameterlist));
        }
コード例 #26
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pBlockingMark"></param>
 /// <returns></returns>
 public DataTable GetByParam(IBlockingMark pBlockingMark)
 {
     return(BlockingEngineDAC.GetByParam(pBlockingMark));
 }
コード例 #27
0
 GetCustomParametersUserExist(IBlockingMark pBlockingMark)
 {
     return(null);
 }
コード例 #28
0
        /// <summary>
        /// Verifica si existe marcas. Si exite alguna marca retorna los usuarios.
        /// </summary>
        /// <param name="pIBlockingMark">Marca</param>
        /// <param name="pCustomParametersExist">Parametros personalizados</param>
        /// <param name="pBlockingTable">Parametros personalizados</param>
        /// <returns></returns>
        internal static List <String> ExistsUsers(IBlockingMark pIBlockingMark, List <SqlParameter> pCustomParametersExist, String pBlockingTable)
        {
            List <string> strUserList = new List <string>();
            SqlParameter  wParam;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
                using (SqlCommand wCmd = new SqlCommand(pBlockingTable + "_g_ExistUser", wCnn))
                {
                    wCmd.CommandType = CommandType.StoredProcedure;
                    if (pCustomParametersExist != null)
                    {
                        if (pCustomParametersExist.Count != 0)
                        {
                            wCmd.Parameters.AddRange(pCustomParametersExist.ToArray());
                        }
                    }

                    if (pIBlockingMark.FwkGuid != null)
                    {
                        wParam       = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                        wParam.Value = pIBlockingMark.FwkGuid;
                    }

                    //BlockingId
                    if (pIBlockingMark.BlockingId != null)
                    {
                        wParam       = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                        wParam.Value = pIBlockingMark.BlockingId;
                    }

                    //Attribute
                    if (pIBlockingMark.Attribute != null)
                    {
                        wParam       = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 50);
                        wParam.Value = pIBlockingMark.Attribute;
                    }
                    //AttValue
                    if (pIBlockingMark.AttValue != null)
                    {
                        wParam       = wCmd.Parameters.Add("@AttValue", SqlDbType.VarChar, 50);
                        wParam.Value = pIBlockingMark.AttValue;
                    }

                    //Process
                    if (pIBlockingMark.Process != null)
                    {
                        wParam       = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 50);
                        wParam.Value = pIBlockingMark.Process;
                    }

                    //TableName
                    if (pIBlockingMark.TableName != null)
                    {
                        wParam       = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 50);
                        wParam.Value = pIBlockingMark.TableName;
                    }

                    wCnn.Open();

                    IDataReader reader = wCmd.ExecuteReader();
                    while (reader.Read())
                    {
                        strUserList.Add(reader["UserName"].ToString());
                    }
                    return(strUserList);
                }
        }
コード例 #29
0
ファイル: BlockingEngineDAC.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>
        /// Verifica si existe marcas. Si exite alguna marca retorna el registro.
        /// </summary>
        /// <param name="pIBlockingMark">Marca</param>
        /// <param name="pCustomParametersExist">Parametros personalizados</param>
        /// <param name="pBlockingTable">Nombre de la tabla de Blocking</param>
        /// <returns>Registro blocking</returns>
        internal static bool Exists(IBlockingMark pIBlockingMark, String pBlockingTable)
        {
            SqlParameter wParam;
            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
            using (SqlCommand wCmd = new SqlCommand(pBlockingTable + "_g_Exist", wCnn))
            {
                Boolean wExist;

                wCmd.CommandType = CommandType.StoredProcedure;

                wParam = wCmd.Parameters.Add("@Exist", SqlDbType.Bit);
                wParam.Direction = ParameterDirection.Output;

                if (pIBlockingMark.FwkGuid != null)
                {
                    wParam = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                    wParam.Value = pIBlockingMark.FwkGuid;
                }

                //BlockingId
                if (pIBlockingMark.BlockingId != null)
                {
                    wParam = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int);
                    wParam.Value = pIBlockingMark.BlockingId;
                }

                wCnn.Open();
                wCmd.ExecuteNonQuery();
                wExist = Boolean.Parse(wCmd.Parameters["@Exist"].Value.ToString());

                return wExist;

            }
        }
コード例 #30
0
ファイル: BlockingEngineBase.cs プロジェクト: gpanayir/sffwk
 public DataTable GetByParam(IBlockingMark pBlockingMark)
 {
     return BlockingEngineDAC.GetByParam(pBlockingMark);
 }
コード例 #31
0
ファイル: BlockingEngineDAC.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>
        /// Obtiene una o valraias marcas de bloqueo 
        /// </summary>
        /// <param name="pIBlockingMark">Clase que implementa IBlockingMark</param>
        /// <param name="pCustomParametersGetByParam">Parametros para una IBlockingMark personalizada</param>
        /// <returns>Tabla con laas marcas obtenidas.-</returns>
        internal static DataTable GetByParam(IBlockingMark pIBlockingMark, List<SqlParameter> pCustomParametersGetByParam)
        {
            DataSet wDS = new DataSet();
            SqlParameter wParam;
            string wUsuario = string.Empty;

            using (SqlConnection wCnn = new SqlConnection(msz_ConnectionString))
            using (SqlCommand wCmd = new SqlCommand(pIBlockingMark.TableName + "_s", wCnn))
            {

                wCmd.CommandType = CommandType.StoredProcedure;
                if (pCustomParametersGetByParam != null)
                {
                    if (pCustomParametersGetByParam.Count != 0)
                    {
                        wCmd.Parameters.AddRange(pCustomParametersGetByParam.ToArray());
                    }
                }

                //BlockingId
                wParam = wCmd.Parameters.Add("@BlockingId", SqlDbType.Int, 4);
                wParam.Value = pIBlockingMark.BlockingId;

                //TableName
                wParam = wCmd.Parameters.Add("@TableName", SqlDbType.VarChar, 100);
                wParam.Value = pIBlockingMark.TableName;

                //Attribute
                wParam = wCmd.Parameters.Add("@Attribute", SqlDbType.VarChar, 100);
                wParam.Value = pIBlockingMark.Attribute;

                //TTL
                wParam = wCmd.Parameters.Add("@TTL", SqlDbType.Int, 4);
                wParam.Value = pIBlockingMark.TTL;

                //UserName
                wParam = wCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 32);
                wParam.Value = pIBlockingMark.User;

                //FwkGuid
                wParam = wCmd.Parameters.Add("@FwkGuid", SqlDbType.UniqueIdentifier);
                wParam.Value = pIBlockingMark.FwkGuid;

                //DueDate
                wParam = wCmd.Parameters.Add("@DueDate", SqlDbType.DateTime);
                wParam.Value = pIBlockingMark.DueDate;

                //Process
                wParam = wCmd.Parameters.Add("@Process", SqlDbType.VarChar, 50);
                wParam.Value = pIBlockingMark.Process;

                SqlDataAdapter wDA = new SqlDataAdapter(wCmd);

                wDA.Fill(wDS);
                return wDS.Tables[0];

            }
        }
コード例 #32
0
ファイル: BlockingEngineBase.cs プロジェクト: gpanayir/sffwk
 public DataTable GetByParamCustom(IBlockingMark pBlockingMark)
 {
     List<SqlParameter> wSqlParameterlist = GetCustomParametersToGetByParams(pBlockingMark);
     return BlockingEngineDAC.GetByParam(pBlockingMark, wSqlParameterlist);
 }
コード例 #33
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pBlockingMark"></param>
 /// <returns></returns>
 protected abstract List <SqlParameter> GetCustomParametersToGetByParams(IBlockingMark pBlockingMark);
コード例 #34
0
ファイル: BlockingEngineBase.cs プロジェクト: gpanayir/sffwk
 protected abstract List<SqlParameter> GetCustomParametersToGetByParams(IBlockingMark pBlockingMark);
コード例 #35
0
ファイル: FwkBlockingEngine.cs プロジェクト: gpanayir/sffwk
     GetCustomParametersToInsert(IBlockingMark pBlockingMark)
 {
     return null;
 }
コード例 #36
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pBlockingMark"></param>
 /// <returns></returns>
 protected abstract List <SqlParameter> GetCustomParametersUserExist(IBlockingMark pBlockingMark);
コード例 #37
0
ファイル: FwkBlockingEngine.cs プロジェクト: gpanayir/sffwk
     GetCustomParametersUserExist(IBlockingMark pBlockingMark)
 {
     return null;
 }
コード例 #38
0
        /// <summary>
        /// Verifica si existe marcas. Si exite alguna marca retorna los usuarios.
        /// </summary>
        /// <param name="pBlockingMark"></param>
        /// <returns></returns>
        public List <string> ExistsUser(IBlockingMark pBlockingMark)
        {
            List <SqlParameter> wSqlParameterlist = GetCustomParametersUserExist(pBlockingMark);

            return(BlockingEngineDAC.ExistsUsers(pBlockingMark, wSqlParameterlist, _Table_BlockingMarks_Name));
        }