コード例 #1
0
        public static void AgregarRegistrador(Registrador r)
        {
            using (SqlConnection con = new SqlConnection(SqlServer.CADENA_CONEXION))

            {
                con.Open();
                string     textoCmd = "insert into Registrador (Nombre, Direccion, Nro_Documento, Telefono, Observacion) values (@Nombre, @Direccion, @Nro_Documento, @Telefono, @Observacion)";
                SqlCommand cmd      = new SqlCommand(textoCmd, con);
                cmd = r.ObtenerParametros(cmd);
                cmd.ExecuteNonQuery();
            }
        }
コード例 #2
0
        public static void ActualizarRegistrador(Registrador r, int indice)
        {
            using (SqlConnection con = new SqlConnection(SqlServer.CADENA_CONEXION))
            {
                con.Open();
                string textoCMD = "update Registrador set Nombre = @Nombre, Direccion = @Direccion, Nro_Documento = @Nro_Documento, Telefono = @Telefono, Observacion = @Observacion where Id_Registrador = @Id_Registrador";

                SqlCommand cmd = new SqlCommand(textoCMD, con);
                cmd = r.ObtenerParametros(cmd, true);

                cmd.ExecuteNonQuery();
            }
        }