//Obtener PerIdentifica
 public DataTable Get_PerIdentifica(BE_ReqPerIdentifica Request)
 {
     //Recuperando registros
     DataTable dt = new DataTable();
     DA_Persona Obj = new DA_Persona();
     return Obj.Get_PerIdentifica(Request);
 }
Esempio n. 2
0
        //------------------------------------------------------------------------------
        //[usp_Get_ExistePerIdentifica] para Verificar si existe Nro. docu PerIdentifica
        //------------------------------------------------------------------------------
        public int Get_ExistePerIdentifica(BE_ReqPerIdentifica Request)
        {
            int nResultado = 0;
            try
            {
                clsConection Obj = new clsConection();
                string Cadena = Obj.GetConexionString("Naylamp");
                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();

                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "[usp_Get_ExistePerIdentifica]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("nPerIdeTipo", Request.nPerIdeTipo);
                        cm.Parameters.AddWithValue("cPerIdeNumero", Request.cPerIdeNumero);
                        cm.Connection = cn;

                        SqlParameter pCod = new SqlParameter();
                        pCod.ParameterName = "nRows";
                        pCod.DbType =  DbType.Int32;
                        //pCod.Size = 25;
                        pCod.Direction = ParameterDirection.Output;

                        cm.Parameters.Add(pCod);
                        cm.ExecuteNonQuery();
                        nResultado = Convert.ToInt32(cm.Parameters["nRows"].Value);
                    }
                }

            }
            catch (Exception)
            {
                throw;
            }
            return nResultado;
        }
Esempio n. 3
0
        //----------------
        // PerIdentifica
        //----------------
        //Insert
        public BE_ResGenerico InsPerIdentifica(BE_ReqPerIdentifica  Request)
        {
            BE_ResGenerico Item = new BE_ResGenerico();
            long Resultado = 0;
            try
            {
                clsConection Obj = new clsConection();
                string Cadena = Obj.GetConexionString("Naylamp");

                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();

                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "[usp_Ins_PerIdentifica]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("cPerCodigo", Request.cPerCodigo);
                        cm.Parameters.AddWithValue("nPerIdeTipo", Request.nPerIdeTipo);
                        cm.Parameters.AddWithValue("cPerIdeNumero", Request.cPerIdeNumero);
                        cm.Connection = cn;
                        Resultado = cm.ExecuteNonQuery();
                        Item.Resultado = Resultado;
                    }
                }

            }
            catch (Exception)
            {
                throw;
            }
            return Item;
        }
Esempio n. 4
0
        //Obtener todos los tipos docu. por persona
        public DataTable Get_PerIdentifica(BE_ReqPerIdentifica Request)
        {
            DataTable dt = new DataTable();
            try
            {
                clsConection Obj = new clsConection();
                string Cadena = Obj.GetConexionString("Naylamp");

                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();
                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "[usp_Get_PerIdentifica]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("cPerCodigo", Request.cPerCodigo);
                        cm.Connection = cn;

                        using (SqlDataReader dr = cm.ExecuteReader())
                            dt.Load(dr);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return dt;
        }
 //[usp_Get_ExistePerIdentifica]
 public int Get_ExistePerIdentifica(BE_ReqPerIdentifica Request)
 {
     DA_Persona Obj = new DA_Persona();
     return Obj.Get_ExistePerIdentifica(Request);
 }
 //----------------
 // PerIdentifica
 //----------------
 public BE_ResGenerico InsPerIdentifica(BE_ReqPerIdentifica Request)
 {
     BE_ResGenerico Item = new BE_ResGenerico();
     DA_Persona Obj = new DA_Persona();
     Item = Obj.InsPerIdentifica(Request);
     return Item;
 }