Exemplo n.º 1
0
        /// <summary>
        ///Get CVECAROL
        ///</summary>
        public override SoftvList <CVECAROLEntity> GetPagedList(int pageIndex, int pageSize, String xml)
        {
            SoftvList <CVECAROLEntity> entities = new SoftvList <CVECAROLEntity>();

            using (SqlConnection connection = new SqlConnection(SoftvSettings.Settings.CVECAROL.ConnectionString))
            {
                SqlCommand comandoSql = CreateCommand("Softv_CVECAROLGetPagedXml", connection);

                AssingParameter(comandoSql, "@pageSize", pageSize);
                AssingParameter(comandoSql, "@pageIndex", pageIndex);
                AssingParameter(comandoSql, "@xml", xml);
                IDataReader rd = null;
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    rd = ExecuteReader(comandoSql);
                    while (rd.Read())
                    {
                        entities.Add(GetCVECAROLFromReader(rd));
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Error getting data CVECAROL " + ex.Message, ex);
                }
                finally
                {
                    if (connection != null)
                    {
                        connection.Close();
                    }
                    if (rd != null)
                    {
                        rd.Close();
                    }
                }
                entities.totalCount = GetCVECAROLCount(xml);
                return(entities ?? new SoftvList <CVECAROLEntity>());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///Get Permiso
        ///</summary>
        public override SoftvList <PermisoEntity> GetXml(String xml)


        {
            SoftvList <PermisoEntity> entities = new SoftvList <PermisoEntity>();

            using (SqlConnection connection = new SqlConnection(SoftvSettings.Settings.Permiso.ConnectionString))
            {
                SqlCommand comandoSql = CreateCommand("Softv_PermisoGetXml", connection);
                AssingParameter(comandoSql, "@xml", xml);
                IDataReader rd = null;
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    rd = ExecuteReader(comandoSql);
                    while (rd.Read())
                    {
                        entities.Add(GetPermisoFromReader(rd));
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Error getting data Permiso " + ex.Message, ex);
                }
                finally
                {
                    if (connection != null)
                    {
                        connection.Close();
                    }
                    if (rd != null)
                    {
                        rd.Close();
                    }
                }
                return(entities ?? new SoftvList <PermisoEntity>());
            }
        }