Exemple #1
0
        public static void AgregarMotivo(Motivo C)
        {
            using (SqlConnection con = new SqlConnection(SqlServer.CADENA_CONEXION))

            {
                con.Open();
                string     textoCmd = "INSERT INTO Motivo (descripcion)VALUES (@descripcion)";
                SqlCommand cmd      = new SqlCommand(textoCmd, con);
                cmd = C.ObtenerParametros(cmd);
                cmd.ExecuteNonQuery();
            }
        }
Exemple #2
0
        public static void EditarMotivo(int index, Motivo C)
        {
            using (SqlConnection con = new SqlConnection(SqlServer.CADENA_CONEXION))
            {
                con.Open();
                string textoCMD = "UPDATE motivo SET descripcion = @descripcion where id = @id";

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

                cmd.ExecuteNonQuery();
            }
        }